GATT BLE variable array formatting?
Posted: Sun Mar 31, 2019 6:44 pm
Hello people of the internet, first ever post on here!
I'm building a BLE client that will hopefully advertise a few GATT services on an ESP32, so far I've got a couple of services working successfully like battery and temperature, with each one on it's own service.
I've already got a few working that have fixed length structures, such as: cycling_power, Sensor_location (0x2A5D) an unsigned 8 bit int. But other characteristics like 'Cycling Power Measurement' have a 'variable length structure containing a Flags field' and I'm not sure how to tackle these.
I will include screenshots from nRF connect app during some reverse engineering attempts I've made. You can see in the value field in the 5th and 6th hexadecimal places that the value increased when I cycled from 0 to 100 watts.
https://ibb.co/fvW9kty
https://ibb.co/8my0QsP
What type should I assign for powerMeasurmentStructure and can setValue be used? Any existing examples would be great!
Thanks in advance!
Louis
I'm building a BLE client that will hopefully advertise a few GATT services on an ESP32, so far I've got a couple of services working successfully like battery and temperature, with each one on it's own service.
I've already got a few working that have fixed length structures, such as: cycling_power, Sensor_location (0x2A5D) an unsigned 8 bit int. But other characteristics like 'Cycling Power Measurement' have a 'variable length structure containing a Flags field' and I'm not sure how to tackle these.
I will include screenshots from nRF connect app during some reverse engineering attempts I've made. You can see in the value field in the 5th and 6th hexadecimal places that the value increased when I cycled from 0 to 100 watts.
https://ibb.co/fvW9kty
https://ibb.co/8my0QsP
Code: Select all
cyclingPower.setValue(powerMeasurmentStructure);
cyclingPower.notify();
Thanks in advance!
Louis