mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
test/sbc+hfp: support original PacketLogger .pklg files with little endian len
This commit is contained in:
parent
2903bcc699
commit
0d719a1e32
@ -107,9 +107,16 @@ static void process_file(const char * pklg_path, const char * wav_path, int pack
|
|||||||
bytes_read = __read(fd, header, sizeof(header));
|
bytes_read = __read(fd, header, sizeof(header));
|
||||||
if (0 >= bytes_read) break;
|
if (0 >= bytes_read) break;
|
||||||
|
|
||||||
uint8_t packet[256];
|
uint32_t size = big_endian_read_32(header, 0);
|
||||||
uint32_t size = big_endian_read_32(header, 0) - 9;
|
|
||||||
|
// auto-detect endianess of size param
|
||||||
|
if (size >0xffff){
|
||||||
|
size = little_endian_read_32(header, 0);
|
||||||
|
}
|
||||||
|
// subtract header
|
||||||
|
size -= 9;
|
||||||
|
|
||||||
|
uint8_t packet[256];
|
||||||
uint8_t type = header[12];
|
uint8_t type = header[12];
|
||||||
|
|
||||||
if (type != packet_type) {
|
if (type != packet_type) {
|
||||||
|
@ -125,7 +125,16 @@ static void process_file(const char * pklg_path, const char * wav_path, int pack
|
|||||||
bytes_read = __read(fd, header, sizeof(header));
|
bytes_read = __read(fd, header, sizeof(header));
|
||||||
if (0 >= bytes_read) break;
|
if (0 >= bytes_read) break;
|
||||||
uint8_t type = header[12];
|
uint8_t type = header[12];
|
||||||
uint32_t size = big_endian_read_32(header, 0) - 9;
|
|
||||||
|
uint32_t size = big_endian_read_32(header, 0);
|
||||||
|
|
||||||
|
// auto-detect endianess of size param
|
||||||
|
if (size >0xffff){
|
||||||
|
size = little_endian_read_32(header, 0);
|
||||||
|
}
|
||||||
|
// subtract header
|
||||||
|
size -= 9;
|
||||||
|
|
||||||
uint8_t packet[300];
|
uint8_t packet[300];
|
||||||
|
|
||||||
if (type == packet_type){
|
if (type == packet_type){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user