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

Function bluetooth_write_data

src/utils/bluetooth/bluetooth_functions.cpp:60–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int bluetooth_write_data (char *data, int size, char *mac_addr)
61{
62 if ((data == NULL) || (mac_addr == NULL) || (size < 0))
63 {
64 return (int)SocketBluetoothReturnCodes::PARAMETER_ERROR;
65 }
66
67 std::lock_guard<std::mutex> lock (mutex);
68
69 std::string key = mac_addr;
70 auto device_it = devices.find (key);
71 if (device_it == devices.end ())
72 {
73 return (int)SocketBluetoothReturnCodes::DEVICE_IS_NOT_CREATED_ERROR;
74 }
75 return device_it->second->send (data, size);
76}
77
78int bluetooth_close_device (char *mac_addr)
79{

Callers 3

config_boardMethod · 0.85
config_boardMethod · 0.85
TESTFunction · 0.85

Calls 1

sendMethod · 0.45

Tested by 1

TESTFunction · 0.68