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

Method recv

src/tests/utils/bluetooth/socket_bluetooth_test.cpp:34–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34int SocketBluetooth::recv (char *data, int size)
35{
36 if (data == NULL)
37 {
38 return 0;
39 }
40
41 int n_bytes = 0;
42 switch (port)
43 {
44 case BRAINFLOW_TEST_BLUETOOTH_ALL_BYTES_AVAILABLE_PORT:
45 n_bytes = BRAINFLOW_TEST_BLUETOOTH_EXPECTED_BYTES;
46 case BRAINFLOW_TEST_BLUETOOTH_SOME_BYTES_AVAILABLE_PORT:
47 n_bytes = BRAINFLOW_TEST_BLUETOOTH_EXPECTED_BYTES / 2;
48 default:
49 n_bytes = 0;
50 }
51
52 if (n_bytes >= size)
53 {
54 for (auto i = 0; i < size; i++)
55 {
56 data[i] = BRAINFLOW_TEST_BLUETOOTH_DATA_CHAR;
57 }
58 return size;
59 }
60
61 return 0;
62}
63
64int SocketBluetooth::close ()
65{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected