⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Robert Reichel
Offline
Last seen:3 years 2 weeks ago
Joined:2017-09-01 09:25
ble_peripheral example

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:
TMiranda
Offline
Last seen:2 years 6 months ago
Joined:2017-11-16 18:00
Your question might be

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.

Robert Reichel
Offline
Last seen:3 years 2 weeks ago
Joined:2017-09-01 09:25
Thank you, I can finally read

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.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi Robert Reichel,

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