cancel
Showing results for 
Search instead for 
Did you mean: 

BLE_p2pServer Example: Why adding 2 to aPeerToPeerContext.P2PNotifyServerToClientCharHdle

BGeor.1
Associate II

I would like to know why 2 is added to the P2PNotifyServerToClientCharHdle while checking for an attribute handle match in p2p_stm.c file. Later in the same function, 1 is added to P2PWriteClientToServerCharHdle. Is there an implicit assumption made here to add 2 to a notify handle and 1 to a write characteristic handle. 

P2PNotifyServerToClientCharHdle is declared as uint16_t. Why add 2 to an integer for matching to Attr_Handle.

 

static SVCCTL_EvtAckStatus_t PeerToPeer_Event_Handler(void *Event)

{

SVCCTL_EvtAckStatus_t return_value;

hci_event_pckt *event_pckt;

evt_blecore_aci *blecore_evt;

aci_gatt_attribute_modified_event_rp0 * attribute_modified;

P2PS_STM_App_Notification_evt_t Notification;

 

return_value = SVCCTL_EvtNotAck;

event_pckt = (hci_event_pckt *)(((hci_uart_pckt*)Event)->data);

 

switch(event_pckt->evt)

{

case HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE:

{

blecore_evt = (evt_blecore_aci*)event_pckt->data;

switch(blecore_evt->ecode)

{

case ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE:

{

attribute_modified = (aci_gatt_attribute_modified_event_rp0*)blecore_evt->data;

if(attribute_modified->Attr_Handle == (aPeerToPeerContext.P2PNotifyServerToClientCharHdle + 2))

{

/**

* Descriptor handle

*/

return_value = SVCCTL_EvtAckFlowEnable;

/**

 

 

0 REPLIES 0