如何从android ble扫描结果中获取CRC? [英] How can get CRC from android ble scan result?

查看:250
本文介绍了如何从android ble扫描结果中获取CRC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每次都从ble设备接收到62字节的扫描结果.

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

使用下面的回调代码获取扫描结果,我可以获取RSSI但不能获取CRC. 或者 一帧获得CRC的逻辑是什么?

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?

来自诸如封包头,广告数据,CRC,RSSI之类的设备的数据格式.

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

如何从数据或android ble模块获取CRC.

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         
}

如何从扫描结果中获取CRC?

How can get CRC from scan result?

推荐答案

为什么要使用CRC?蓝牙控制器将丢弃CRC与数据包内容不匹配的数据包.

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

Bluetooth控制器不会将CRC转发到主CPU,因此您无法获取它.

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

另外,这62个字节是两个数据包的串联:广告数据和扫描响应数据.

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

这篇关于如何从android ble扫描结果中获取CRC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆