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

Method find_bt_addr

src/board_controller/bt_lib_board.cpp:203–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203int BTLibBoard::find_bt_addr (const char *name_selector)
204{
205 int (*func_find) (char *, char *, int *) =
206 (int (*) (char *, char *, int *))dll_loader->get_address ("bluetooth_discover_device");
207 if (func_find == NULL)
208 {
209 safe_logger (
210 spdlog::level::err, "failed to get function address for bluetooth_discover_device");
211 return (int)BrainFlowExitCodes::GENERAL_ERROR;
212 }
213 char mac_addr[40];
214 int len = 0;
215 int res = func_find (const_cast<char *> (name_selector), mac_addr, &len);
216 if (res == (int)SocketBluetoothReturnCodes::STATUS_OK)
217 {
218 std::string mac_string = mac_addr;
219 params.mac_address = mac_string.substr (0, len);
220 }
221
222 return res;
223}

Callers

nothing calls this directly

Calls 1

get_addressMethod · 0.45

Tested by

no test coverage detected