comparison efrtest/dlcap-sync.c @ 472:d80ccb3c3970

gsmefr-dlcap-sync: use DHF datum in the library
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 14 May 2024 07:30:48 +0000
parents 4104b0390fab
children
comparison
equal deleted inserted replaced
471:b5f8ea41362b 472:d80ccb3c3970
10 #include <stdio.h> 10 #include <stdio.h>
11 #include <stdint.h> 11 #include <stdint.h>
12 #include <stdlib.h> 12 #include <stdlib.h>
13 #include <string.h> 13 #include <string.h>
14 #include <strings.h> 14 #include <strings.h>
15 15 #include "../libgsmefr/gsm_efr.h"
16 static const uint8_t efr_dhf[31] = {
17 0xC0,0x85,0xEB,0x49,0x0F,0xAA,0xD6,0x03,0xE3,0xA1,0x86,0x07,0xB0,0xC4,0x2C,0x08,
18 0x04,0x80,0x55,0x80,0x00,0x00,0x00,0x00,0x03,0x6B,0x00,0x00,0x00,0x00,0x00,
19 };
20 16
21 static const uint8_t mr122_dhf[31] = { 17 static const uint8_t mr122_dhf[31] = {
22 0xC0,0x85,0x4D,0xB9,0x6A,0xAA,0xD6,0x00,0x00,0x00,0x00,0x01,0xB5,0x87,0xF6,0x68, 18 0xC0,0x85,0x4D,0xB9,0x6A,0xAA,0xD6,0x00,0x00,0x00,0x00,0x01,0xB5,0x87,0xF6,0x68,
23 0x37,0x94,0x09,0x00,0x41,0x58,0x54,0xF1,0x0F,0x6B,0x02,0x40,0x3C,0x7E,0xA0, 19 0x37,0x94,0x09,0x00,0x41,0x58,0x54,0xF1,0x0F,0x6B,0x02,0x40,0x3C,0x7E,0xA0,
24 }; 20 };
93 if ((status_words[0] & 0xC204) != 0xC000) { 89 if ((status_words[0] & 0xC204) != 0xC000) {
94 dhf_state = 0; 90 dhf_state = 0;
95 continue; 91 continue;
96 } 92 }
97 efr_tidsp_to_std(tidsp_bytes, efr_bytes); 93 efr_tidsp_to_std(tidsp_bytes, efr_bytes);
98 if (!bcmp(efr_bytes, efr_dhf, 31)) { 94 if (!bcmp(efr_bytes, EFR_decoder_homing_frame, 31)) {
99 dhf_state = 1; 95 dhf_state = 1;
100 continue; 96 continue;
101 } 97 }
102 if (!bcmp(efr_bytes, mr122_dhf, 31)) { 98 if (!bcmp(efr_bytes, mr122_dhf, 31)) {
103 dhf_state = 2; 99 dhf_state = 2;