- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody!
I'm using PSoC 6 BLE PROTOTYPING KIT and I configurated it in Broadcaster GAP Role.
I would like to TURN_ON a pin every time an adv packet is sent and do it at the same time!
How can I implement it? Is there a way to know when a adv packet is sent?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi clme_4503246,
You can use Cy_BLE_SetCustomEventMask(CY_BLE_ADV_TX_EVENT_MASK) to enable advertisement packet sent events. As result you will receive CY_BLE_EVT_GAP_ADV_TX events when an advertisement packet is sent over the air. You can call Cy_BLE_SetCustomEventMask function in CY_BLE_EVT_STACK_ON event from application BLE callback.
void AppCallBack(uint32_t event, void* eventParam)
{
switch (event)
{
case CY_BLE_EVT_STACK_ON:
Cy_BLE_SetCustomEventMask(CY_BLE_ADV_TX_EVENT_MASK);
break;case CY_BLE_EVT_GAP_ADV_TX:
// Do some processing here...
// NOTE:
// CY_BLE_EVT_GAP_ADV_TX will be generated when adv packet is sent across 1 ADV channel,// so in default configuration ADV comes across 3 ADV channels (37, 38, 39),
// so you should count CY_BLE_EVT_GAP_ADV_TX (e.g 3 times) before TURN_ON/OFF a pin.
break;
…
}
}}
}
Regards,
Nazar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi clme_4503246,
You can use Cy_BLE_SetCustomEventMask(CY_BLE_ADV_TX_EVENT_MASK) to enable advertisement packet sent events. As result you will receive CY_BLE_EVT_GAP_ADV_TX events when an advertisement packet is sent over the air. You can call Cy_BLE_SetCustomEventMask function in CY_BLE_EVT_STACK_ON event from application BLE callback.
void AppCallBack(uint32_t event, void* eventParam)
{
switch (event)
{
case CY_BLE_EVT_STACK_ON:
Cy_BLE_SetCustomEventMask(CY_BLE_ADV_TX_EVENT_MASK);
break;case CY_BLE_EVT_GAP_ADV_TX:
// Do some processing here...
// NOTE:
// CY_BLE_EVT_GAP_ADV_TX will be generated when adv packet is sent across 1 ADV channel,// so in default configuration ADV comes across 3 ADV channels (37, 38, 39),
// so you should count CY_BLE_EVT_GAP_ADV_TX (e.g 3 times) before TURN_ON/OFF a pin.
break;
…
}
}}
}
Regards,
Nazar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content