MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / owb_search_first

Function owb_search_first

modules/drivers/onewire/esp/owb.c:497–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497owb_status owb_search_first(const OneWireBus * bus, OneWireBus_SearchState * state, bool* found_device)
498{
499 bool result;
500 owb_status status;
501
502 if(!bus || !state || !found_device)
503 {
504 status = OWB_STATUS_PARAMETER_NULL;
505 } else if (!_is_init(bus))
506 {
507 status = OWB_STATUS_NOT_INITIALIZED;
508 } else
509 {
510 memset(&state->rom_code, 0, sizeof(state->rom_code));
511 state->last_discrepancy = 0;
512 state->last_family_discrepancy = 0;
513 state->last_device_flag = false;
514 _search(bus, state, &result);
515 status = OWB_STATUS_OK;
516
517 *found_device = result;
518 }
519
520 return status;
521}
522
523owb_status owb_search_next(const OneWireBus * bus, OneWireBus_SearchState * state, bool* found_device)
524{

Callers 2

xs_onewire_searchFunction · 0.85
xs_onewire_isPresentFunction · 0.85

Calls 2

_is_initFunction · 0.85
_searchFunction · 0.85

Tested by

no test coverage detected