Imitating a BLE device with a ESP32
Posted: Thu May 10, 2018 2:53 pm
Hi.
I'm trying to imitate a BLE wireless controller (for a standalone VR helmet), so I've looked what services does the controller advertise and tried to replicate them.
And failed.
1) First things first, BLEDevice::createServer() seems to automatically create GenericAccess service with DeviceName and Appearance characterstics (and another numeric one) in it.
I'd like to insert PeripheralPreferredConnectionParameters characteristic into it, but:
- I couldn't find an easy way to hook up to an existing BLEService (is it possible using BLEServiceMap?)
- I couldn't find in the libraries down to Espressif documentation where is it exactly created
2) When I create another GenericAccess it is created fine, though PeripheralPreferredConnectionParameters characteristic in it appears, but is not populated at all, no matter how I try.
3) And PnPID characteristic in DeviceInformation service isn't shown whatsoever.
Everything else is there, but for PnPID.
I'm not sure this is why my imitation is not recognized by the device I want it to pair, but I'd like to eliminate all possibilities.
Also I want to apologize if I'm trying to overwrite things specifically not meant to be overwritten.
Aside from this project I have no BLE or BT experience, so I'm playing copycat without understanding fully what these characteristics are for.
Thank you.
I'm trying to imitate a BLE wireless controller (for a standalone VR helmet), so I've looked what services does the controller advertise and tried to replicate them.
And failed.
1) First things first, BLEDevice::createServer() seems to automatically create GenericAccess service with DeviceName and Appearance characterstics (and another numeric one) in it.
I'd like to insert PeripheralPreferredConnectionParameters characteristic into it, but:
- I couldn't find an easy way to hook up to an existing BLEService (is it possible using BLEServiceMap?)
- I couldn't find in the libraries down to Espressif documentation where is it exactly created
2) When I create another GenericAccess it is created fine, though PeripheralPreferredConnectionParameters characteristic in it appears, but is not populated at all, no matter how I try.
3) And PnPID characteristic in DeviceInformation service isn't shown whatsoever.
Everything else is there, but for PnPID.
I'm not sure this is why my imitation is not recognized by the device I want it to pair, but I'd like to eliminate all possibilities.
Also I want to apologize if I'm trying to overwrite things specifically not meant to be overwritten.
Aside from this project I have no BLE or BT experience, so I'm playing copycat without understanding fully what these characteristics are for.
Thank you.