mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-14 01:27:41 +00:00
prefix crc8_* to btstack_crc8_*
This commit is contained in:
parent
1f41c2c9f7
commit
63dd1c760e
@ -393,7 +393,7 @@ static uint8_t crc8(uint8_t *data, uint16_t len){
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
uint8_t crc8_check(uint8_t *data, uint16_t len, uint8_t check_sum){
|
||||
uint8_t btstack_crc8_check(uint8_t *data, uint16_t len, uint8_t check_sum){
|
||||
uint8_t crc;
|
||||
crc = crc8(data, len);
|
||||
crc = crc8table[crc ^ check_sum];
|
||||
@ -405,7 +405,7 @@ uint8_t crc8_check(uint8_t *data, uint16_t len, uint8_t check_sum){
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
uint8_t crc8_calc(uint8_t *data, uint16_t len){
|
||||
uint8_t btstack_crc8_calc(uint8_t *data, uint16_t len){
|
||||
/* Ones complement */
|
||||
return 0xFF - crc8(data, len);
|
||||
}
|
||||
|
@ -257,8 +257,8 @@ uint32_t btstack_atoi(const char *str);
|
||||
* CRC8 functions using ETSI TS 101 369 V6.3.0.
|
||||
* Only used by RFCOMM
|
||||
*/
|
||||
uint8_t crc8_check(uint8_t *data, uint16_t len, uint8_t check_sum);
|
||||
uint8_t crc8_calc(uint8_t *data, uint16_t len);
|
||||
uint8_t btstack_crc8_check(uint8_t *data, uint16_t len, uint8_t check_sum);
|
||||
uint8_t btstack_crc8_calc(uint8_t *data, uint16_t len);
|
||||
|
||||
/* API_END */
|
||||
|
||||
|
@ -508,7 +508,7 @@ static int rfcomm_send_packet_for_multiplexer(rfcomm_multiplexer_t *multiplexer,
|
||||
if ((control & 0xef) == BT_RFCOMM_UIH){
|
||||
crc_fields = 2;
|
||||
}
|
||||
rfcomm_out_buffer[pos++] = crc8_calc(rfcomm_out_buffer, crc_fields); // calc fcs
|
||||
rfcomm_out_buffer[pos++] = btstack_crc8_calc(rfcomm_out_buffer, crc_fields); // calc fcs
|
||||
|
||||
int err = l2cap_send_prepared(multiplexer->l2cap_cid, pos);
|
||||
|
||||
@ -533,7 +533,7 @@ static int rfcomm_send_uih_prepared(rfcomm_multiplexer_t *multiplexer, uint8_t d
|
||||
pos += len;
|
||||
|
||||
// UIH frames only calc FCS over address + control (5.1.1)
|
||||
rfcomm_out_buffer[pos++] = crc8_calc(rfcomm_out_buffer, 2); // calc fcs
|
||||
rfcomm_out_buffer[pos++] = btstack_crc8_calc(rfcomm_out_buffer, 2); // calc fcs
|
||||
|
||||
int err = l2cap_send_prepared(multiplexer->l2cap_cid, pos);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user