The successive searches of a 1-Wire bus, one device each.
More...
#include <onewire_search.h>
|
| | RomSearch (Bus &bus) |
| |
| bool | next (uint8_t(&rom)[8]) |
| | Finds the next device on the bus.
|
| |
template<typename Bus>
class RomSearch< Bus >
The successive searches of a 1-Wire bus, one device each.
- Template Parameters
-
| Bus | Has reset() (true if a device answers), write(uint8_t), read_bit() and write_bit(uint8_t), as OneWire. |
uint8_t rom[8];
while (search.next(rom)) { ... }
Definition at line 45 of file onewire_search.h.
◆ RomSearch()
◆ next()
template<typename Bus>
| bool RomSearch< Bus >::next |
( |
uint8_t(&) | rom[8] | ) |
|
|
inline |
Finds the next device on the bus.
- Parameters
-
| rom | Its ROM code: family code first, CRC last (to check by the caller). The same array at each call: a search follows the previous code up to its last conflict. |
- Returns
- false when every device has been found, if no device answers, or if the bus does not answer as expected (the search then starts over at the next call).
Definition at line 61 of file onewire_search.h.
◆ bus
◆ lastDevice
◆ lastDiscrepancy
template<typename Bus>
| uint8_t RomSearch< Bus >::lastDiscrepancy { 0 } |
|
private |
◆ SEARCH_ROM
template<typename Bus>
| uint8_t RomSearch< Bus >::SEARCH_ROM { 0xF0 } |
|
staticconstexprprivate |
The documentation for this class was generated from the following file: