Dear Dialog_Support,
1. My requirement is to start advertising whenever i short press the push button and stop advertising on long press of the push button. Is it possible to implement this? If yes then how to implement this?
2. I want to store some data permanently into flash and also modify whenever requirement of data modification then how to implement this? What are the steps required to implement this? Do i need to erase the sector everytime i write something into flash? How many max write and erase cycles are available for DA14583 board?
Thank you in advance.
With Regards,
前腿帕特尔
Device:
Hi Ruchi Patel,
In order to implement a short and a long press button you should add a timer into the callback function that is registered into the wkupct_register_callback(). When the timer elapses, you should check the status of the button. If it is not pressed this means that is a short press but if it is still pressed this means that is a long press. So, if you detect a short press button and the device isn’t advertising you should call the user_app_adv_start(), and if you detect a long press button and the device is advertising, you should stop the advertising with the user_app_adv_stop (). This function is not implemented in the SDK, so you should implement your own function to stop advertising by calling the app_easy_gap_advertise_stop() into the user_app_adv_stop (). Also, you could check some previous threads on the forum:
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-da1458x-bt42-%E2%80%93-software/button-long-press-detection
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/button-press-time
Regarding your second question, I suggest you to have a look at the Smart Tag application project and check how the bonding data are stored in the SPI Flash. The internal SPI Flash of the DA14583 SoC, supports 100,000 erase/program cycles at minimum.
Thanks, PM_Dialog