BLE basics | Cypress Semiconductor
I am trying to become a convert from the PIC community.
I have watched almost all Cypress videos on PSoC Creator and BLE.
I am working with the EZBLE PRoC Module in my 'Widget' design. My widgets only direct interface with the user is the pushbutton that wakes the widget from hibernation and when the user plugs a USB cable in to charge the LIR2032 battery.
I am trying to create a custom BLE profile but I am getting lost in the details.
Here is what I am trying to do:
My widget has about ten 8bit configuration variables that need to to adjusted on my 'iPhone' yet persistently stored on the widget.
I do not need continuous polling, I plan to simply have a user initiated request sent from the iPhone that is labeled 'Obtain Current Settings from Widget NOW'. Then the user modifies the variables on the iPhone and finishes by initiating an 'Update these Settings to the Widget NOW' action. The widget would respond with an acknowledgment of receipt of new values and the user would see the acknowledgment on the iPhone or be informed that the widget has not responded.
This method should use minimal energy from the widgets battery if implemented properly.
Some basic questions that I have in creating my custom profile are:
1. Would I select Client and Server as the Profile Role?
2. Would I select Peripheral and Central in the GAP Role?
3. What services would I need in the Client and Server?
4. How would I set up the characteristics to send and receive this data?
5. How would I set up the code on my widget to listen for requests/data from the the iPhone using the least energy? (perhaps I could have the iPhone try sending for 5 seconds and the widget only look for requests from iPhone every 4 seconds or something like that)
6. A non-BLE question, how would I make these configuration variables persistent on my widget when the battery is removed or my program code reloaded. On my PIC widget, which does not have EEPROM, I reserve some program memory that my linker and programmer does not erase and I write these variables to that program memory area?
7. Is there any sample code project that could help me?