⚠️
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.
2 posts / 0 new
Last post
magergar
Offline
Last seen:3 months 3 weeks ago
加入:2020-05-26 18:20
Add Custom Service

How can I add a new service or characteristics to my bluetooth aplication?

what I'm trying to acomplish is read a sensor(ADC, I2C) and/or to modify the duty cycle of the PWM through an app but I can't find the information to create characteristics and how to modify it remotly or local

And since It's not recomended to modify the main loop how can I setup a periodical reading? using a timer?, I know the bluetooth works with events but I can't find a way to make it works

for example:
I need to read a temperature sensor every 2min and modify the Duty cicle of my pwm acording to the temperature but I also would like to connect to the bluetooth and read the actual temperature or modify the duty cycle via smartphone

I Have no problem with the peripherals I know how to use them since I been working with the peripheral examples but now I don't know how to add them to my bluetooth aplication.

PM_Dialog
Offline
Last seen:1 day 1 hour ago
工作人员
加入:2018-02-08 11:03
嗨magergar,

嗨magergar,

The ble_app_petipheral example of the SDK can be taken as a reference. Please check out app_adcval1_timer_cb_handler() in order to understand how to send notifications to the peer device. The specific example is under projects\target_apps\ble_examples\ble_app_peripheral path.

Please check out theDA14531-DA14585-586 Reading I2C Accelerometer BLESW Example. That example is using BLE notifications in order to send data to a peer device.

You can also take a look at the CodeLess example and you will find detailed examples in the user guide.

//www.wsdof.com/products/smartbond-codeless-commands

I would recommend also checking the following tutorials :

http://lpccs-docs.dialog-semiconductor.com/DA145xx_Advertising_Tutorial/index.html

http://lpccs-docs.dialog-semiconductor.com/Tutorial_SDK6/index.html

http://lpccs-docs.dialog-semiconductor.com/tutorial-custom-profile-DA145xx/index.html

Thanks, PM_Dialog