Hi,
我有麻烦与ble_peripheral服务le.
How do I add an characteristic where I can read ADC values? Just reading dummy values would be enough for the time being,
but I can not manage to advertise dummy values to read with my smartphone. Even the existing ADC 1 and 2 Characteristics
do not show me any data.
Kind Regards,
Robert
Device:
Your question might be responded here:https://support.dialog-semiconductor.com/custom-profile-reading-characte...
In fact, you can read the ADC 1 values on the ble_peripheral example when you write 0x01 on your Control Point. (it will trigger a timer and update the ADC Value 1 automatically)
I'm trying to read a dummy value just by pressing the READ button on my application (LightBlue on iOS) on a new custom profile, but no luck so far. I will post here if I do it, since the option above might not be what you're looking for.
Thank you, I can finally read dummy values with the adc value 1 profile.
I am new to this, I am sorry if i overlooked something simple or don't get the answer in your response, but what exactly happens when the READ button is pressed? I still don`t get how the data is sent to the central when the READ button is pressed since the handler functions of adc value 1 are empty.
Hi Robert Reichel,
This forum category is related to the thread, please use the Bluetooth categories in order to post additional questions regarding BLE.
The ble_app_peripheral example sends ADC dummy values to your peripheral via notifications, you will just have to enable the notifications on the central side in order for your client to start getting data (after writting 0x01 on the control point). If you dont enable the notifications and you would like to just read the data from the central side then you can go ahead and hit the read button, you will then get the current value that is stored in the database updated via the notification interval. When you send a notification (as the example does) the message triggers the notification and the handler of the message also updated the values in the database, so when the central reads the value, it send a message over BLE and the stack responds without sending an indication to application level that someone has read that particular characteristic, there is an alternative way of getting indications to the application level when a read operation occurs, please check the following post for more information:
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...
https://support.dialog-semiconductor.com/gattcreadcmdind-da14580
Thanks MT_dialog