| 32 | } |
| 33 | |
| 34 | int 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 | |
| 64 | int SocketBluetooth::close () |
| 65 | { |
nothing calls this directly
no outgoing calls
no test coverage detected