src/patch.c
__attribute__((at(0x00218F00, "", CHIP_VER_BCM4375B1_BT, FW_VER_S20)))
int check_frame(uint8_t *frame,uint8_t size,uint8_t *start) {
	int valid = 0;
	*start = 0;
	for (int i=0;i<size-2;i++) {
		if (crc16(frame+i,size-2-i) == ((frame[size-1]<<8) | frame[size-2])) {
			valid = 1;
			*start = i;
			break;
		}
		if (dongle_mode == 1 && frame[i] == 0x11 && frame[i+1] == 0x22) {
			valid = 1;
			*start = i;
		}
	}
	return valid;
}
/*
Function allowing to check if a Mosart frame includes a valid CRC
*/
Function allowing to check if a Mosart frame includes a valid CRC
Function allowing to check if a Mosart frame includes a valid CRC
__attribute__((at(0x00218F00, "", CHIP_VER_BCM4375B1_BT, FW_VER_S20)))
int check_frame(uint8_t *frame,uint8_t size,uint8_t *start) {
	int valid = 0;
	*start = 0;
	for (int i=0;i<size-2;i++) {
		if (crc16(frame+i,size-2-i) == ((frame[size-1]<<8) | frame[size-2])) {
			valid = 1;
			*start = i;
			break;
		}
		if (dongle_mode == 1 && frame[i] == 0x11 && frame[i+1] == 0x22) {
			valid = 1;
			*start = i;
		}
	}
	return valid;
}
__attribute__ ( ( at ( 0x00218F00 , " " , CHIP_VER_BCM4375B1_BT , FW_VER_S20 ) ) ) int check_frame ( uint8_t * frame , uint8_t size , uint8_t * start ) { int valid = 0 ; * start = 0 ; for ( int i = 0 ; i < size - 2 ; i ++ ) { if ( crc16 ( frame + i , size - 2 - i ) == ( ( frame [ size - 1 ] << 8 ) | frame [ size - 2 ] ) ) { valid = 1 ; * start = i ; break ; } if ( dongle_mode == 1 && frame [ i ] == 0x11 && frame [ i + 1 ] == 0x22 ) { valid = 1 ; * start = i ; } } return valid ; }
Function allowing to check if a Mosart frame includes a valid CRC
Function allowing to check if a Mosart frame includes a valid CRC