COSA
An Object-Oriented Platform for Arduino Programming
DS18B20::Search Class Reference

#include <DS18B20.hh>

Inheritance diagram for DS18B20::Search:
Inheritance graph
Collaboration diagram for DS18B20::Search:
Collaboration graph

Public Member Functions

 Search (OWI *owi)
 
DS18B20next ()
 
void reset ()
 

Protected Types

enum  { FIRST = -1, ERROR = -1, LAST = ROMBITS }
 

Protected Member Functions

uint8_t * rom ()
 
bool update_rom ()
 
int8_t search_rom (int8_t last=FIRST)
 
bool read_rom ()
 
bool match_rom ()
 
bool skip_rom ()
 
int8_t alarm_search (int8_t last=FIRST)
 
bool connect (uint8_t family, uint8_t index)
 
virtual void on_alarm ()
 
int8_t search (int8_t last=FIRST)
 

Protected Attributes

uint8_t m_family
 
int8_t m_last
 
str_P NAME
 
uint8_t m_rom [ROM_MAX]
 
const uint8_t * ROM
 
Driverm_next
 
OWIm_pin
 

Detailed Description

Alarm search support class.

Definition at line 54 of file DS18B20.hh.

Member Enumeration Documentation

anonymous enum
inherited
Enumerator
FIRST 
ERROR 
LAST 

Definition at line 60 of file OWI.hh.

Constructor & Destructor Documentation

DS18B20::Search::Search ( OWI owi)
inline

Construct an alarm search iterator for the thermometer device family.

Parameters
[in]owione-wire pin to search.

Definition at line 61 of file DS18B20.hh.

Member Function Documentation

int8_t OWI::Driver::alarm_search ( int8_t  last = FIRST)
inherited

Search alarming device given the last position of discrepancy. Negative value for start from the beginning.

Parameters
[in]lastposition of discrepancy.
Returns
position of difference or negative error code.

Definition at line 264 of file OWI.cpp.

bool OWI::Driver::connect ( uint8_t  family,
uint8_t  index 
)
inherited

Connect to one-wire device with given family code and index.

Parameters
[in]familydevice family code.
[in]indexdevice order.
Returns
true(1) if successful otherwise false(0).

Definition at line 272 of file OWI.cpp.

bool OWI::Driver::match_rom ( )
inherited

Match device rom. Address the slave device with the rom code. Device specific function command should follow. May be used to verify rom code.

Returns
true(1) if successful otherwise false(0).

Definition at line 244 of file OWI.cpp.

DS18B20 * DS18B20::Search::next ( )

Get the next thermometer with active alarm since latest convert request. The temperature value that triggered the alarm is read.

Returns
pointer to driver or null(0).

Definition at line 25 of file DS18B20.cpp.

virtual void OWI::Driver::on_alarm ( )
inlinevirtualinherited

Callback on alarm dispatch. Default is empty function.

Definition at line 159 of file OWI.hh.

bool OWI::Driver::read_rom ( )
inherited

Read device rom. This can only be used when there is only one slave on the bus.

Returns
true(1) if successful otherwise false(0).

Definition at line 236 of file OWI.cpp.

void OWI::Search::reset ( )
inlineinherited

Reset iterator.

Definition at line 206 of file OWI.hh.

uint8_t* OWI::Driver::rom ( )
inlineinherited

Return pointer to device rom.

Returns
device rom buffer.

Definition at line 96 of file OWI.hh.

int8_t OWI::Driver::search ( int8_t  last = FIRST)
protectedinherited

Search device rom given the last position of discrepancy. Negative value for start from the beginning.

Parameters
[in]lastposition of discrepancy.
Returns
position of difference or negative error code.

Definition at line 182 of file OWI.cpp.

int8_t OWI::Driver::search_rom ( int8_t  last = FIRST)
inherited

Search device rom given the last position of discrepancy. Negative value for start from the beginning.

Parameters
[in]lastposition of discrepancy.
Returns
position of difference or negative error code.

Definition at line 228 of file OWI.cpp.

bool OWI::Driver::skip_rom ( )
inherited

Skip device rom for boardcast or single device access. Device specific function command should follow.

Returns
true(1) if successful otherwise false(0).

Definition at line 256 of file OWI.cpp.

bool OWI::Driver::update_rom ( )
inherited

Update the rom identity (in EEPROM). Return true(1) if successful otherwise false(0). Typically used to save configuration after connect(). return bool.

Definition at line 174 of file OWI.cpp.

Member Data Documentation

uint8_t OWI::Search::m_family
protectedinherited

Definition at line 212 of file OWI.hh.

int8_t OWI::Search::m_last
protectedinherited

Definition at line 213 of file OWI.hh.

Driver* OWI::Driver::m_next
protectedinherited

Definition at line 164 of file OWI.hh.

OWI* OWI::Driver::m_pin
protectedinherited

Definition at line 165 of file OWI.hh.

uint8_t OWI::Driver::m_rom[ROM_MAX]
protectedinherited

Definition at line 162 of file OWI.hh.

str_P OWI::Driver::NAME
inherited

Name of device driver instance.

Definition at line 67 of file OWI.hh.

const uint8_t* OWI::Driver::ROM
protectedinherited

Definition at line 163 of file OWI.hh.


The documentation for this class was generated from the following files: