MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / open_device

Function open_device

src/board_controller/neuromd/brainbit_bglib/main.cpp:80–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

uart_openFunction · 0.70
reset_ble_devFunction · 0.70
wait_for_callbackFunction · 0.70
open_ble_devFunction · 0.70

Tested by

no test coverage detected