Q: I would like to receive low level EEG data from BBit using BLE library on Linux/Win10 (using Rust lang)
Hi folks I'm trying to connect and start receiving EEG data from BBit device using Rust BLE library.
- I can lookup UUID's using 'discover_adapters_peripherals'. Code connects to BLE device and gathers UUID characterictics. So I'm getting following data for BB.
` Found BLE peripheral : 'Some("BrainBit")' : address = [209, 151, 75, 13, 199, 241] is connected: false start connect to peripheral : Some("BrainBit") = [209, 151, 75, 13, 199, 241]... now connected ('true') to peripheral : Some("BrainBit")... Discover peripheral : 'Some("BrainBit")' characteristics...
Characteristic { start_handle: 2, end_handle: 65535, value_handle: 3, uuid: 2A:00, properties: READ | WRITE }
Characteristic { start_handle: 4, end_handle: 65535, value_handle: 5, uuid: 2A:01, properties: READ }
Characteristic { start_handle: 6, end_handle: 65535, value_handle: 7, uuid: 2A:04, properties: READ }
Characteristic { start_handle: 9, end_handle: 65535, value_handle: 10, uuid: 2A:05, properties: INDICATE }
Characteristic { start_handle: 13, end_handle: 65535, value_handle: 14, uuid: 6E:40:00:02:B5:34:F3:93:68:A9:E5:0E:24:DC:CA:9E, properties: READ | NOTIFY }
Characteristic { start_handle: 16, end_handle: 65535, value_handle: 17, uuid: 6E:40:00:03:B5:34:F3:93:68:A9:E5:0E:24:DC:CA:9E, properties: WRITE }
Characteristic { start_handle: 18, end_handle: 65535, value_handle: 19, uuid: 6E:40:00:04:B5:34:F3:93:68:A9:E5:0E:24:DC:CA:9E, properties: NOTIFY }
Characteristic { start_handle: 22, end_handle: 65535, value_handle: 23, uuid: 2A:24, properties: READ }
Characteristic { start_handle: 24, end_handle: 65535, value_handle: 25, uuid: 2A:25, properties: READ }
Characteristic { start_handle: 26, end_handle: 65535, value_handle: 27, uuid: 2A:27, properties: READ }
Characteristic { start_handle: 28, end_handle: 65535, value_handle: 29, uuid: 2A:26, properties: READ }
disconnecting from peripheral : Some("BrainBit")... `
So I can assume there is a
uuid: 6E:40:00:04:B5:34:F3:93:68:A9:E5:0E:24:DC:CA:9E, properties: NOTIFY 0x6e400004_b534_f393_68a9_e50e24dcca9e that I can use for getting data.
- Next I'm trying run subscribe uuid notify example
I'm updated corresponding example with constant changes like:
const PERIPHERAL_NAME_MATCH_FILTER: &str = "BrainBit"; const NOTIFY_CHARACTERISTIC_UUID: Uuid = Uuid::from_u128(0x6e400004_b534_f393_68a9_e50e24dcca9e);
So I'm going to connect to BB device and subscribe to uuid = 0x6e400004_b534_f393_68a9_e50e24dcca9e
That example should connect to BLE, subscribe to specified uuid and should receive 4 data packets.
But.... this example doesn't work for me, it connects, subscribes to uuid, but no data is received, it's just hangs and waits for data infinitly. I checked and see that incorrect behaviour on Linux and Win10 platforms.
So I have a questions.
- Are there another 'commands or pre-conditions' should be applied before subscribing notify events ??
Because now I'm not sure if there is something wrong with Rust BLE library (some sort of internal issues) or I'm not doing something (like sending some command to BB) ?
- Can you give a description of uuid services ? Which service is used for ? Like one uuid is 'battery level', another for receiving commands, etc...
- Can you put a description of packets data format ?
Thank you for your help.