Looking at the nRF51 UART Example, i know that all packets transmitted over a BLE link will be protected by CRC on the link layer.
But how about when nRF51 scan the ibeacon, and the data is send over uart, will the data still protected by CRC??
Hi,
CRC is not part of the UART protocol. If you want CRC, you will have to implement this in software on both sides of the connection.
Alternatively, you can use the parity bit for error detection. The parity bit is enabled by setting use_parity = true
in UART communication parameters structure. Notice that the parity bit is even parity.
Best regards,
Jørgen
Hi,
CRC is not part of the UART protocol. If you want CRC, you will have to implement this in software on both sides of the connection.
Alternatively, you can use the parity bit for error detection. The parity bit is enabled by setting use_parity = true
in UART communication parameters structure. Notice that the parity bit is even parity.
Best regards,
Jørgen
Hi Jørgen, Thanks a lot for the answer, i got a bit confused. Is that means every time the nrf51 detects any ibeacon, the ibeacon will undergo crc test. The package which is found error will be blocked. However, when the data pass over uart, there will be no crc to protect the data, and error could happen in this process, am i right? Regarding to first solution, is that any sample as reference??
Correct, the link layer of BLE ensures that all packages are received and checked against the CRC. If CRC check on a received package fails, a retransmission request is sent until the packet is received correctly. UART does not provide this reliable data link, and any CRC checking or retransmission request must be done in software. Unfortunately, I cannot provide you with an example of software CRC check for UART, but you should be able to find some information about calculating the CRC value, using your favorite search engine.