You are here

Filtering scanned data | Cypress Semiconductor

Filtering scanned data

Summary: 2 Replies, Latest post by dturney_1462731 on 12 Apr 2016 08:34 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
dturney_1462731's picture
35 posts

This might be more of a C programming question, but, in my app, when a device is scanned, there are several bytes in the CYBLE_GAPC_ADV_REPORT_T advReport->data (The advertisement packet) that need to be picked out in order to be directed to the next step.  I know the simple way of just looking at each byte in the array, but I want put it all in a struct, and just the necessary bytes.  For example, if a device includes the Service UUID (32-bit) + Service Data, which bytes are in advReport->data[16]-[22]: how can I put those in

struct scannedData {

    uint32 serviceID;

    uint8* serviceData;


BMAH's picture
Cypress Employee
189 posts

You can extract the values inside the event CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT. 

For e.g., 

            advReport=*(CYBLE_GAPC_ADV_REPORT_T *)eventParam;

In your application, you can probably use a memcpy function - memcpy(&newScan.serviceID, &[16], sizeof(uint32));       

dturney_1462731's picture
35 posts

So, using the memcpy function, using "&[16], sizeof(uint32)" as one end of the comparison will pull the (4) 8-byte values from

Log in to post new comments.