| 78 | } |
| 79 | |
| 80 | int open_device (void *param) |
| 81 | { |
| 82 | if (uart_open (uart_port)) |
| 83 | { |
| 84 | return (int)BrainFlowExitCodes::UNABLE_TO_OPEN_PORT_ERROR; |
| 85 | } |
| 86 | int res = reset_ble_dev (); |
| 87 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 88 | { |
| 89 | return res; |
| 90 | } |
| 91 | exit_code = (int)BrainFlowExitCodes::SYNC_TIMEOUT_ERROR; |
| 92 | state = State::OPEN_CALLED; |
| 93 | ble_cmd_gap_discover (gap_discover_observation); |
| 94 | res = wait_for_callback (timeout); |
| 95 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 96 | { |
| 97 | return res; |
| 98 | } |
| 99 | ble_cmd_gap_end_procedure (); |
| 100 | return open_ble_dev (); |
| 101 | } |
| 102 | |
| 103 | int open_device_mac_addr (void *param) |
| 104 | { |
nothing calls this directly
no test coverage detected