| 201 | } |
| 202 | |
| 203 | int 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 | } |
nothing calls this directly
no test coverage detected