This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Measure time from write attribute to acknowledging client

Hi,

I have SimpleBLEPeripheral running on the keyfob with few modifications.  The application client running on Nexus 7 connects to the keyfob over BLE.  When an attribute is written by the client the keyfob updates the PWM output.  I want to measure the time from when the keyfob receives a write attribute request to acknowledging the client application running on the Nexus 7.  What two APIs should I add instrumentation (GPIO triggers) to measure this delay.

We are seeing up to 1.5 second delay at the Nexus 7 side and we want to rule out the keyfob end.

Thanks,

  • Hi Ed,

    When the CC254x receives a write request, the simpleProfile_WriteAttrCB is called in simpleGATTprofile.c. You will see case statements for each characteristics that can be written. The response/acknowledgement is sent in the lower level of the stack. I believe you can use a sniffer to see which time the packets are received over the air to get an estimate.

     

     

     

  • Hi Zahid,

    I tried to use the TI USB dongle and packet sniffer but did not see any packets captured.  The advertisement messages appear but no other packets once the two BLE devices are connected.  I learned that there are 40 channels and 3 channels are used for adv packets and transferring the hop table.  I read that I need three USB dongles to capture BLE packet data on packet sniffer because the hop table is sent only once and is on one of the three channels.  It is a hit and miss if using one TI USB dongle with packet sniffer.  

    I have used the TI USB dongle with packet sniffer and works great.  The BLE is a different story.

    Regards,

    Ed

  • Leaving the "connect to initiator address" box unchecked should cause the sniffer to follow the data packets of the first connection it sees. Unfortunately this only works sometimes...

  • One trick to capture air sniff traces is to limit the peripheral device to advertising on a single channel and then in the sniffer/Radio Configuration select that same advertising channel. 

    uint8 desired_channels = GAP_ADVCHAN_39;
    retVal |= GAPRole_SetParameter( GAPROLE_ADV_CHANNEL_MAP, sizeof( uint8 ), &desired_channels );