Oh and I would need the same point when it advertises :)
I am talking about a GATT Server and Gap peripheral setup.
Or, is there a way to intercept the following mentioned interrupt so that I can read my sensor and process ble events while the rf section is spooling up and sending/receiving data (3ms each time):
'the BLE Sub-system and the micro-controller are woken up by an interrupt every advertisement interval(in case of a GAP Peripheral) or connection interval (in case of GAP Central).'??
So I have been searching the whole BLE generated code for this but with my limited understading of things, I can not find any place where I can insert my code.
I have created an image of a 3ms connection 'event' from AN92584 which I have attached (if you are having trouble viewing the jpg, treat yourself and install Picassa Photo Viewer, it zooms with scroll wheel and drags around screen with left drag).
I only need less than 300us of Active mode to piggyback on.
I have tried starting BLE_bless_isr and even with a CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP) in the CY_ISR(BLE_bless_isr_Interrupt), the sytem never goes to DEEP SLEEP and connections actually stop working after the isr is started.
Does anyone see the advantages of being able to do what I envision as I do?
Connection Current.jpg 468.7 K
Darn, I thought I had a way.
I thought I could just use the event in my BLE eventhandler where values are received from the GATT client (CYBLE_EVT_GATTS_WRITE_REQ), but that only executes when the data ACTUALLY CHANGES. If the data does not change there is still a connection event every connection interval. I tried all 7 GATTS events and non of them seem to execute every interval.
If I keep rambling I am hoping someone takes pity on me :)
I found that the BLE subsystem wakes the device from deep sleep at least 4 times per connection/advertising event.
The solution was to isolate the first wakeup using CySysClkEcoReadStatus.
Could you tell me what happens when you and try and debug the code?