如何使用蓝牙低功耗设备检查完整性?如何使用Ble设备获取时间戳? [英] How to check integrity with Bluetooth low energy devices ? How to get timestamp with Ble devices?

查看:121
本文介绍了如何使用蓝牙低功耗设备检查完整性?如何使用Ble设备获取时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道MIC和CRC与ble数据包一起存在,但是我不知道ble设备是否可以进行完整性检查,或者我必须实现提供此功能的代码.

I know that MIC and CRC exists with ble data packet but i don't know if checking integrity is available with ble devices or i have to implement a code that offer this .

对于时间戳,我可以从ble设备获取时间来知道消息何时发送.

For timestamp , can i get the time from ble devices to know when the message is sent .

推荐答案

CRC和MIC是数据包的一部分,已经在链路层级别进行了检查.您无需在应用程序中实现额外的代码即可进行此检查.

CRC and MIC are part of the data packets and checked already on Link Layer level. You do not need to implement extra code in your appliccation to do this checking.

来自BLE设备的数据包不会自动包含时间戳.请注意,许多外围设备甚至都没有时钟,因此无法知道当前时间.

Data packets from a BLE device do not automatically contain a time stamp. Note that many peripheral devices do not even have a clock and thus can't know the current time.

如果您想在邮件中添加时间戳,通常有两个选择:

If you want to have a time stamp with your message, you typically have two options:

1)您将时间记录在中央设备上;在这种情况下,时间戳是传入的读取响应/通知/指示的时间.这样做的优点是易于实现,但是在实际收集数据时会丢失信息,如果在收集和接收数据之间存在时间上的差异,这可能很重要.

1) You log the time on the central device; in this case, the time stamp is the time of the incoming read response/notification/indication. This has the advantage that it is easy to implement, but you lose the information when the data was actually collected, which may be important if there is a relevant time discrepancy between collection and receiving of the data.

2)您将时间记录在外围设备上,并将其作为附加数据与原始消息一起发送(例如,在消息末尾添加一些表示日期和时间的字节).这是推荐的方法,但是您必须能够定义外围设备发送的消息.如果您只能控制中央,则无法使用此选项.

2) You log the time on the peripheral device and send it as additional data together with the original message (for example, adding a few bytes at the end of the message that represent the date and time). This is the recommended approach, but you have to be able to define the messages sent by the peripheral device. If you only have control over the central, this option is not possible.

这篇关于如何使用蓝牙低功耗设备检查完整性?如何使用Ble设备获取时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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