2
votes

I have receive scan result with 62 bytes each and every time from ble device.

Using below callback code to get scan result, I can able to get RSSI but not getting CRC. or What is the logic for getting CRC for one frame?

Format of data from ble device like Packet Header,Advertising data,CRC,RSSI.

how can get CRC from data or android ble module.

public void onScanResult(int callbackType, ScanResult result) {
    byte[] data = result.getScanRecord().getBytes();
    //get 62 byte array         
}

How can get CRC from scan result?

1

1 Answers

1
votes

Why do you want the CRC? The Bluetooth controller will discard packets where the CRC doesn't match the packet contents.

The Bluetooth controller does not forward the CRC to the main CPU so you you can't get it.

Also, the 62 bytes are a concatenation of two packets: the advertising data and the scan response data.