问题
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 .
For timestamp , can i get the time from ble devices to know when the message is sent .
回答1:
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.
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) 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) 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.
来源:https://stackoverflow.com/questions/42488754/how-to-check-integrity-with-bluetooth-low-energy-devices-how-to-get-timestamp