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

Function bluetooth_get_data

src/utils/bluetooth/bluetooth_functions.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42int bluetooth_get_data (char *data, int size, char *mac_addr)
43{
44 if ((data == NULL) || (mac_addr == NULL) || (size < 0))
45 {
46 return (int)SocketBluetoothReturnCodes::PARAMETER_ERROR;
47 }
48
49 std::lock_guard<std::mutex> lock (mutex);
50
51 std::string key = mac_addr;
52 auto device_it = devices.find (key);
53 if (device_it == devices.end ())
54 {
55 return (int)SocketBluetoothReturnCodes::DEVICE_IS_NOT_CREATED_ERROR;
56 }
57 return device_it->second->recv (data, size);
58}
59
60int bluetooth_write_data (char *data, int size, char *mac_addr)
61{

Callers 3

read_threadMethod · 0.85
read_threadMethod · 0.85
TESTFunction · 0.85

Calls 1

recvMethod · 0.45

Tested by 1

TESTFunction · 0.68