How can get CRC from android ble scan result?

我怕爱的太早我们不能终老 提交于 2019-12-11 04:09:11

问题


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:


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.



来源:https://stackoverflow.com/questions/50167451/how-can-get-crc-from-android-ble-scan-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!