| 495 | } |
| 496 | |
| 497 | owb_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 | |
| 523 | owb_status owb_search_next(const OneWireBus * bus, OneWireBus_SearchState * state, bool* found_device) |
| 524 | { |
no test coverage detected