4 Replies Latest reply on May 15, 2019 6:54 PM by rotu_3236376

    PSoC BLE comparing data field in scan response CYBLE_GAPC_ADV_REPORT_T




      Im trying to write a simple IF condition based on some values or length of the data in the scan response result.  My question is about the dataLen field, should I be comparing this field as an int or hex? This is what my condition looks like.  Notice the "OR" statement.


        if(((advReport->eventType == CYBLE_GAPC_SCAN_RSP) && (advReport->data[1] == 0xff) \


        && (advReport->data[2] == 0x31) && (advReport->data[3] == 0x01) \

        && (advReport->data[4] == 0x3b) && (advReport->data[5] == 0x04)) || (advReport->dataLen == 0x0b))





      I was to check if the dataLen field is "11".  How should that portionof the statement should be written:


      (advReport->dataLen == 0x0b)

      or this

      (advReport->dataLen == 11)



      Also, what is the dataLen property actually counting? Is it the length of the entire response packet including headers or is it just the response data? According to the documentation it is the length of the data for each device that responded to scanning. I am not sure what this means but I would like to check the specific length of the data I am sending in the advertising packet.