NMT: Rework on frame (message) types

This commit is contained in:
Andreas Eversberg
2016-07-20 07:51:28 +02:00
parent 8906deb5dd
commit efb50532c6
3 changed files with 174 additions and 141 deletions

View File

@@ -113,59 +113,61 @@ uint16_t nmt_encode_area_no(uint8_t area_no)
/* NMT Doc 450-1 4.3.2 */ /* NMT Doc 450-1 4.3.2 */
static struct nmt_frame { static struct nmt_frame {
enum nmt_mt message_type;
const char *digits; const char *digits;
enum nmt_direction direction; enum nmt_direction direction;
int prefix; int prefix;
const char *nr; const char *nr;
const char *description; const char *description;
} nmt_frame[] = { } nmt_frame[] = {
/* Digits Dir. Prefix Nr. Description */ /* Define Digits Dir. Prefix Nr. Description */
/*0*/ { "NNNPYYHHHHHHHHHH", MTX_TO_MS, 12, "1a", "Calling channel indication" }, { NMT_MESSAGE_1a, "NNNPYYHHHHHHHHHH", MTX_TO_MS, 12, "1a", "Calling channel indication" },
/*1*/ { "NNNPYYHHHHHHHHHH", MTX_TO_MS, 4, "1b", "Combined calling and traffic channel indication" }, { NMT_MESSAGE_1b, "NNNPYYHHHHHHHHHH", MTX_TO_MS, 4, "1b", "Combined calling and traffic channel indication" },
/*2*/ { "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2a", "Call to mobile subscriber on calling channel" }, { NMT_MESSAGE_2a, "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2a", "Call to mobile subscriber on calling channel" },
/*3*/ { "NNNPYYZXXXXXXnnn", MTX_TO_MS, 12, "2b", "Traffic channel allocation on calling channel" }, { NMT_MESSAGE_2b, "NNNPYYZXXXXXXnnn", MTX_TO_MS, 12, "2b", "Traffic channel allocation on calling channel" },
/*4*/ { "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2c", "Queueing information to MS with priority on calling channel" }, { NMT_MESSAGE_2c, "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2c", "Queueing information to MS with priority on calling channel" },
/*5*/ { "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2d", "Traffic channel scanning order on calling channel" }, { NMT_MESSAGE_2d, "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2d", "Traffic channel scanning order on calling channel" },
/*6*/ { "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2f", "Queuing information to ordinary MS" }, { NMT_MESSAGE_2f, "NNNPYYZXXXXXXHHH", MTX_TO_MS, 12, "2f", "Queuing information to ordinary MS" },
/*7*/ { "NNNPYYZXXXXXXnnn", MTX_TO_MS, 5, "3a", "Traffic channel allocation on traffic channel" }, { NMT_MESSAGE_3a, "NNNPYYZXXXXXXnnn", MTX_TO_MS, 5, "3a", "Traffic channel allocation on traffic channel" },
/*8*/ { "NNNPYYZXXXXXXHHH", MTX_TO_MS, 5, "3b", "Identity request on traffic channel" }, { NMT_MESSAGE_3b, "NNNPYYZXXXXXXHHH", MTX_TO_MS, 5, "3b", "Identity request on traffic channel" },
/*9*/ { "NNNPYYZXXXXXXnnn", MTX_TO_MS, 9, "3c", "Traffic channel allocation on traffic channel, short procedure" }, { NMT_MESSAGE_3c, "NNNPYYZXXXXXXnnn", MTX_TO_MS, 9, "3c", "Traffic channel allocation on traffic channel, short procedure" },
/*10*/ { "NNNPYYJJJJJJJHHH", MTX_TO_MS, 3, "4", "Free traffic channel indication" }, { NMT_MESSAGE_4, "NNNPYYJJJJJJJHHH", MTX_TO_MS, 3, "4", "Free traffic channel indication" },
/*11*/ { "NNNPYYZXXXXXXLLL", MTX_TO_MS, 6, "5a", "Line signal" }, { NMT_MESSAGE_5a, "NNNPYYZXXXXXXLLL", MTX_TO_MS, 6, "5a", "Line signal" },
/*12*/ { "NNNPYYZXXXXXXLQQ", MTX_TO_MS, 6, "5b", "Line signal: Answer to coin-box" }, { NMT_MESSAGE_5b, "NNNPYYZXXXXXXLQQ", MTX_TO_MS, 6, "5b", "Line signal: Answer to coin-box" },
/*13*/ { "JJJPJJJJJJJJJJJJ", MTX_TO_XX, 0, "6", "Idle frame" }, { NMT_MESSAGE_6, "JJJPJJJJJJJJJJJJ", MTX_TO_XX, 0, "6", "Idle frame" },
/*14*/ { "NNNPYYCCCCCCCJJJ", MTX_TO_MS, 8, "7", "Authentication request" }, { NMT_MESSAGE_7, "NNNPYYCCCCCCCJJJ", MTX_TO_MS, 8, "7", "Authentication request" },
/*15*/ { "NNNPZXXXXXXTJJJJ", MS_TO_MTX, 1, "10a", "Call acknowledgement from MS on calling channel (shortened frame)" }, { NMT_MESSAGE_8, "NNNPYYMHHHHHHHWW", MTX_TO_MS, 1, "8", "A-subscriber number" },
/*16*/ { "NNNPZXXXXXXTYKKK", MS_TO_MTX, 1, "10b", "Seizure from ordinary MS and identity on traffic channel" }, { NMT_MESSAGE_10a, "NNNPZXXXXXXTJJJJ", MS_TO_MTX, 1, "10a", "Call acknowledgement from MS on calling channel (shortened frame)" },
/*17*/ { "NNNPZXXXXXXTYKKK", MS_TO_MTX, 6, "10c", "Seizure and identity from called MS on traffic channel" }, { NMT_MESSAGE_10b, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 1, "10b", "Seizure from ordinary MS and identity on traffic channel" },
/*18*/ { "NNNPZXXXXXXTYKKK", MS_TO_MTX, 14, "11a", "Roaming updating seizure and identity on traffic channel" }, { NMT_MESSAGE_10c, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 6, "10c", "Seizure and identity from called MS on traffic channel" },
/*19*/ { "NNNPZXXXXXXTYKKK", MS_TO_MTX, 15, "11b", "Seizure and call achnowledgement on calling channel from MS with priority (shortened frame)" }, { NMT_MESSAGE_11a, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 14, "11a", "Roaming updating seizure and identity on traffic channel" },
/*20*/ { "NNNPZXXXXXXTYKKK", MS_TO_MTX, 11, "12", "Seizure from coin-box on traffic channel" }, { NMT_MESSAGE_11b, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 15, "11b", "Seizure and call achnowledgement on calling channel from MS with priority (shortened frame)" },
/*21*/ { "NNNPZXXXXXXLLLLL", MS_TO_MTX, 8, "13a", "Line signal" }, { NMT_MESSAGE_12, "NNNPZXXXXXXTYKKK", MS_TO_MTX, 11, "12", "Seizure from coin-box on traffic channel" },
/*22*/ { "NNNPZXXXXXXLLLQQ", MS_TO_MTX, 8, "13b", "Line signal: Answer acknowledgement from coin box" }, { NMT_MESSAGE_13a, "NNNPZXXXXXXLLLLL", MS_TO_MTX, 8, "13a", "Line signal" },
/*23*/ { "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14a", "Digit signal (1st, 3rd, 5th ........digit)" }, { NMT_MESSAGE_13b, "NNNPZXXXXXXLLLQQ", MS_TO_MTX, 8, "13b", "Line signal: Answer acknowledgement from coin box" },
/*24*/ { "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14b", "Digit signal (2nd, 4th, 6th ........digit)" }, { NMT_MESSAGE_14a, "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14a", "Digit signal (1st, 3rd, 5th ........digit)" },
/*25*/ { "JJJPJJJJJJJJJJJJ", XX_TO_MTX, 0, "15", "Idle frame" }, { NMT_MESSAGE_14b, "NNNPZXXXXXXSSSSS", MS_TO_MTX, 7, "14b", "Digit signal (2nd, 4th, 6th ........digit)" },
/*26*/ { "NNNPRRRRRRRRRRRR", MS_TO_MTX, 12, "16", "Signed response" }, { NMT_MESSAGE_15, "JJJPJJJJJJJJJJJJ", XX_TO_MTX, 0, "15", "Idle frame" },
/*27*/ { "NNNPYYZJJJAfffff", MTX_TO_BS, 15, "20", "Channel activation order" }, { NMT_MESSAGE_16, "NNNPRRRRRRRRRRRR", MS_TO_MTX, 12, "16", "Signed response" },
/*28*/ { "NNNPYYZJJJAJJJJJ", MTX_TO_BS, 15, "20", "Channel activation order" }, { NMT_MESSAGE_20_1, "NNNPYYZJJJAfffff", MTX_TO_BS, 15, "20", "Channel activation order" },
/*29*/ { "NNNPYYZJJJAfffff", MTX_TO_BS, 15, "20", "Channel activation order" }, { NMT_MESSAGE_20_2, "NNNPYYZJJJAJJJJJ", MTX_TO_BS, 15, "20", "Channel activation order" },
/*30*/ { "NNNPYYZJJJAlllff", MTX_TO_BS, 15, "20", "Channel activation order" }, { NMT_MESSAGE_20_3, "NNNPYYZJJJAfffff", MTX_TO_BS, 15, "20", "Channel activation order" },
/*31*/ { "NNNPYYZJJJAlllJJ", MTX_TO_BS, 15, "20", "Channel activation order" }, { NMT_MESSAGE_20_4, "NNNPYYZJJJAlllff", MTX_TO_BS, 15, "20", "Channel activation order" },
/*32*/ { "NNNPYYZJJJVJJnnn", MTX_TO_BS, 3, "21b", "Signal strength measurement order on data channel or idle or free marked traffic channel" }, { NMT_MESSAGE_20_5, "NNNPYYZJJJAlllJJ", MTX_TO_BS, 15, "20", "Channel activation order" },
/*33*/ { "NNNPYYZJJJVJJnnn", MTX_TO_BS, 5, "21c", "Signal strength measurement order on traffic actually used" }, { NMT_MESSAGE_21b, "NNNPYYZJJJVJJnnn", MTX_TO_BS, 3, "21b", "Signal strength measurement order on data channel or idle or free marked traffic channel" },
/*34*/ { "NNNPYYZJJJVVVVVV", MTX_TO_BS, 14, "22", "Order management/maintenance order on idle channel or data channel" }, { NMT_MESSAGE_21c, "NNNPYYZJJJVJJnnn", MTX_TO_BS, 5, "21c", "Signal strength measurement order on traffic actually used" },
/*35*/ { "NNNPZJJAJJJJJJJJ", BS_TO_MTX, 9, "25", "Channel status information" }, { NMT_MESSAGE_22, "NNNPYYZJJJVVVVVV", MTX_TO_BS, 14, "22", "Order management/maintenance order on idle channel or data channel" },
/*36*/ { "NNNPZJJAJJJfllJJ", BS_TO_MTX, 9, "25", "Channel status information" }, { NMT_MESSAGE_25_1, "NNNPZJJAJJJJJJJJ", BS_TO_MTX, 9, "25", "Channel status information" },
/*37*/ { "NNNPZJJAJJJJllJJ", BS_TO_MTX, 9, "25", "Channel status information" }, { NMT_MESSAGE_25_2, "NNNPZJJAJJJfllJJ", BS_TO_MTX, 9, "25", "Channel status information" },
/*38*/ { "NNNPZJJAJJJcccJJ", BS_TO_MTX, 9, "25", "Channel status information" }, { NMT_MESSAGE_25_3, "NNNPZJJAJJJJllJJ", BS_TO_MTX, 9, "25", "Channel status information" },
/*39*/ { "NNNPZJJnnnrrrrrr", BS_TO_MTX, 2, "26", "Signal strength measurement result" }, { NMT_MESSAGE_25_4, "NNNPZJJAJJJcccJJ", BS_TO_MTX, 9, "25", "Channel status information" },
/*40*/ { "NNNPZJJVVVVJJJJJ", BS_TO_MTX, 4, "27", "Response on other management/maintenance order on idle channel or data channel" }, { NMT_MESSAGE_26, "NNNPZJJnnnrrrrrr", BS_TO_MTX, 2, "26", "Signal strength measurement result" },
/*41*/ { "NNNPZJJVVVVJJJJJ", BS_TO_MTX, 13, "28", "Other maintenance information from BS" }, { NMT_MESSAGE_27, "NNNPZJJVVVVJJJJJ", BS_TO_MTX, 4, "27", "Response on other management/maintenance order on idle channel or data channel" },
/*42*/ { "NNNPYYJJJJJJJHHH", MTX_TO_MS, 10, "30", "Test channel indication" }, { NMT_MESSAGE_28, "NNNPZJJVVVVJJJJJ", BS_TO_MTX, 13, "28", "Other maintenance information from BS" },
/*43*/ { "---P------------", MTX_TO_XX, 0, "", "illegal (Spare)" }, { NMT_MESSAGE_30, "NNNPYYJJJJJJJHHH", MTX_TO_MS, 10, "30", "Test channel indication" },
/*44*/ { "---P------------", XX_TO_MTX, 0, "", "illegal (Spare)" }, { NMT_MESSAGE_UKN_MTX, "---P------------", MTX_TO_XX, 0, "", "illegal (Spare)" },
{ NULL, 0, 0, NULL, NULL } { NMT_MESSAGE_UKN_B, "---P------------", XX_TO_MTX, 0, "", "illegal (Spare)" },
{ 0, NULL, 0, 0, NULL, NULL }
}; };
/* store actual number of frames for run-time range check */ /* store actual number of frames for run-time range check */
@@ -395,11 +397,13 @@ static struct nmt_parameter {
{ 'R', "Signed response", param_hex }, { 'R', "Signed response", param_hex },
{ 'l', "Limit strength evaluation", param_hex }, { 'l', "Limit strength evaluation", param_hex },
{ 'c', "c", param_hex }, { 'c', "c", param_hex },
{ 'M', "Sequence Number", param_integer },
{ 'W', "Checksum", param_hex },
{ 0, NULL } { 0, NULL }
}; };
/* Depending on P-value, direction and additional info, frame index (used for /* Depending on P-value, direction and additional info, frame index (used for
* nmt_frame[]) is recoded. * nmt_frame[]) is decoded.
*/ */
static int decode_frame_index(const uint8_t *digits, enum nmt_direction direction, int callack) static int decode_frame_index(const uint8_t *digits, enum nmt_direction direction, int callack)
{ {
@@ -407,151 +411,151 @@ static int decode_frame_index(const uint8_t *digits, enum nmt_direction directio
/* MS/BS TO MTX */ /* MS/BS TO MTX */
switch (digits[3]) { switch (digits[3]) {
case 0: case 0:
return 25; return NMT_MESSAGE_15;
case 1: case 1:
if (callack) if (callack)
return 15; return NMT_MESSAGE_10a;
return 16; return NMT_MESSAGE_10b;
case 2: case 2:
return 39; return NMT_MESSAGE_26;
case 3: case 3:
break; break;
case 4: case 4:
return 40; return NMT_MESSAGE_27;
case 5: case 5:
break; break;
case 6: case 6:
return 17; return NMT_MESSAGE_10c;
case 7: case 7:
if (digits[11] == 0) if (digits[11] == 0)
return 23; return NMT_MESSAGE_14a;
if (digits[11] == 15) if (digits[11] == 15)
return 24; return NMT_MESSAGE_14b;
return -1; return -1;
case 8: case 8:
if (digits[11] == 2) if (digits[11] == 2)
return 22; return NMT_MESSAGE_13b;
return 21; return NMT_MESSAGE_13a;
case 9: case 9:
switch((digits[13] << 8) + (digits[14] << 4) + digits[15]) { switch((digits[13] << 8) + (digits[14] << 4) + digits[15]) {
case 2: case 2:
case 6: case 6:
return 36; return NMT_MESSAGE_25_2;
case 14: case 14:
return 37; return NMT_MESSAGE_25_3;
case 7: case 7:
case 8: case 8:
return 38; return NMT_MESSAGE_25_4;
default: default:
return 35; return NMT_MESSAGE_25_1;
} }
case 10: case 10:
break; break;
case 11: case 11:
return 20; return NMT_MESSAGE_12;
case 12: case 12:
return 26; return NMT_MESSAGE_16;
case 13: case 13:
return 41; return NMT_MESSAGE_28;
case 14: case 14:
return 18; return NMT_MESSAGE_11a;
case 15: case 15:
return 19; return NMT_MESSAGE_11b;
} }
return 44; return NMT_MESSAGE_UKN_B;
} else { } else {
/* MTX to MS/BS */ /* MTX to MS/BS */
switch (digits[3]) { switch (digits[3]) {
case 0: case 0:
return 13; return NMT_MESSAGE_6;
case 1: case 1:
break; return NMT_MESSAGE_8;
case 2: case 2:
break; break;
case 3: case 3:
if (digits[6] == 15) if (digits[6] == 15)
return 32; return NMT_MESSAGE_21b;
return 10; return NMT_MESSAGE_4;
case 4: case 4:
return 1; return NMT_MESSAGE_1b;
case 5: case 5:
if (digits[6] == 15) if (digits[6] == 15)
return 33; return NMT_MESSAGE_21c;
switch((digits[13] << 8) + (digits[14] << 4) + digits[15]) { switch((digits[13] << 8) + (digits[14] << 4) + digits[15]) {
case 0x3f3: case 0x3f3:
case 0x3f4: case 0x3f4:
case 0x3f5: case 0x3f5:
case 0x3f6: case 0x3f6:
case 0x000: case 0x000:
return 8; return NMT_MESSAGE_3b;
default: default:
return 7; return NMT_MESSAGE_3a;
} }
case 6: case 6:
if (digits[13] == 0) if (digits[13] == 0)
return 12; return NMT_MESSAGE_5b;
return 11; return NMT_MESSAGE_5a;
case 7: case 7:
break; break;
case 8: case 8:
return 14; return NMT_MESSAGE_7;
case 9: case 9:
return 9; return NMT_MESSAGE_3c;
case 10: case 10:
return 42; return NMT_MESSAGE_30;
case 11: case 11:
break; break;
case 12: case 12:
/* no subscriber */ /* no subscriber */
if (digits[6] == 0) if (digits[6] == 0)
return 0; return NMT_MESSAGE_1a;
/* battery saving */ /* battery saving */
if (digits[6] == 14) if (digits[6] == 14)
return 0; return NMT_MESSAGE_1a;
/* info to BS (should not happen here) */ /* info to BS (should not happen here) */
if (digits[6] == 15) if (digits[6] == 15)
return 0; return NMT_MESSAGE_1a;
switch((digits[13] << 8) + (digits[14] << 4) + digits[15]) { switch((digits[13] << 8) + (digits[14] << 4) + digits[15]) {
case 0x3f3: case 0x3f3:
case 0x3f4: case 0x3f4:
case 0x3f5: case 0x3f5:
case 0x3f6: case 0x3f6:
case 0x000: case 0x000:
return 2; return NMT_MESSAGE_2a;
case 0x3f0: case 0x3f0:
return 6; return NMT_MESSAGE_2f;
case 0x3f1: case 0x3f1:
return 4; return NMT_MESSAGE_2c;
case 0x3f2: case 0x3f2:
return 5; return NMT_MESSAGE_2d;
default: default:
return 3; return NMT_MESSAGE_2b;
} }
case 13: case 13:
break; break;
case 14: case 14:
if (digits[13] != 15) if (digits[13] != 15)
break; break;
return 34; return NMT_MESSAGE_22;
case 15: case 15:
if (digits[13] != 15) if (digits[13] != 15)
break; break;
switch (digits[10]) { switch (digits[10]) {
case 3: case 3:
return 27; return NMT_MESSAGE_20_1;
case 6: case 6:
case 13: case 13:
return 29; return NMT_MESSAGE_20_3;
case 7: case 7:
case 14: case 14:
return 30; return NMT_MESSAGE_20_4;
case 15: case 15:
return 31; return NMT_MESSAGE_20_5;
default: default:
return 28; return NMT_MESSAGE_20_2;
} }
} }
return 43; return NMT_MESSAGE_UKN_MTX;
} }
} }
@@ -562,6 +566,12 @@ int init_frame(void)
/* check if all digits actually exist */ /* check if all digits actually exist */
for (i = 0; nmt_frame[i].digits; i++) { for (i = 0; nmt_frame[i].digits; i++) {
/* check mesage type */
if (nmt_frame[i].message_type != i) {
PDEBUG(DFRAME, DEBUG_ERROR, "Message type at message index #%d does not have a value of %d, but has %d, please fix!\n", i, i + 1, nmt_frame[i].message_type);
return -1;
}
/* check IEs */
for (j = 0; j < 16; j++) { for (j = 0; j < 16; j++) {
digit = nmt_frame[i].digits[j]; digit = nmt_frame[i].digits[j];
if (digit == '-') if (digit == '-')
@@ -677,6 +687,12 @@ static void disassemble_frame(frame_t *frame, const uint8_t *digits, enum nmt_di
case 'c': case 'c':
frame->c = value; frame->c = value;
break; break;
case 'M':
frame->seq_number = value;
break;
case 'W':
frame->checksum = value;
break;
default: default:
PDEBUG(DFRAME, DEBUG_ERROR, "Digit '%c' does not exist, please fix!\n", digit); PDEBUG(DFRAME, DEBUG_ERROR, "Digit '%c' does not exist, please fix!\n", digit);
abort(); abort();
@@ -796,6 +812,12 @@ static void assemble_frame(frame_t *frame, uint8_t *digits, int debug)
case 'c': case 'c':
value = frame->c; value = frame->c;
break; break;
case 'M':
value = frame->seq_number;
break;
case 'W':
value = frame->checksum;
break;
default: default:
PDEBUG(DFRAME, DEBUG_ERROR, "Digit '%c' does not exist, please fix!\n", digit); PDEBUG(DFRAME, DEBUG_ERROR, "Digit '%c' does not exist, please fix!\n", digit);
abort(); abort();

View File

@@ -1,48 +1,53 @@
#define NMT_MESSAGE_1a 0 enum nmt_mt {
#define NMT_MESSAGE_1b 1 NMT_MESSAGE_1a = 0,
#define NMT_MESSAGE_2a 2 NMT_MESSAGE_1b,
#define NMT_MESSAGE_2b 3 NMT_MESSAGE_2a,
#define NMT_MESSAGE_2c 4 NMT_MESSAGE_2b,
#define NMT_MESSAGE_2d 5 NMT_MESSAGE_2c,
#define NMT_MESSAGE_2f 6 NMT_MESSAGE_2d,
#define NMT_MESSAGE_3a 7 NMT_MESSAGE_2f,
#define NMT_MESSAGE_3b 8 NMT_MESSAGE_3a,
#define NMT_MESSAGE_3c 9 NMT_MESSAGE_3b,
#define NMT_MESSAGE_4 10 NMT_MESSAGE_3c,
#define NMT_MESSAGE_5a 11 NMT_MESSAGE_4,
#define NMT_MESSAGE_5b 12 NMT_MESSAGE_5a,
#define NMT_MESSAGE_6 13 NMT_MESSAGE_5b,
#define NMT_MESSAGE_7 14 NMT_MESSAGE_6,
#define NMT_MESSAGE_10a 15 NMT_MESSAGE_7,
#define NMT_MESSAGE_10b 16 NMT_MESSAGE_8,
#define NMT_MESSAGE_10c 17 NMT_MESSAGE_10a,
#define NMT_MESSAGE_11a 18 NMT_MESSAGE_10b,
#define NMT_MESSAGE_11b 19 NMT_MESSAGE_10c,
#define NMT_MESSAGE_12 20 NMT_MESSAGE_11a,
#define NMT_MESSAGE_13a 21 NMT_MESSAGE_11b,
#define NMT_MESSAGE_13b 22 NMT_MESSAGE_12,
#define NMT_MESSAGE_14a 23 NMT_MESSAGE_13a,
#define NMT_MESSAGE_14b 24 NMT_MESSAGE_13b,
#define NMT_MESSAGE_15 25 NMT_MESSAGE_14a,
#define NMT_MESSAGE_16 26 NMT_MESSAGE_14b,
#define NMT_MESSAGE_20a 27 NMT_MESSAGE_15,
#define NMT_MESSAGE_20b 28 NMT_MESSAGE_16,
#define NMT_MESSAGE_20c 29 NMT_MESSAGE_20_1,
#define NMT_MESSAGE_20d 30 NMT_MESSAGE_20_2,
#define NMT_MESSAGE_20e 31 NMT_MESSAGE_20_3,
#define NMT_MESSAGE_21b 32 NMT_MESSAGE_20_4,
#define NMT_MESSAGE_21c 33 NMT_MESSAGE_20_5,
#define NMT_MESSAGE_22 34 NMT_MESSAGE_21b,
#define NMT_MESSAGE_25a 35 NMT_MESSAGE_21c,
#define NMT_MESSAGE_25b 36 NMT_MESSAGE_22,
#define NMT_MESSAGE_25c 37 NMT_MESSAGE_25_1,
#define NMT_MESSAGE_25d 38 NMT_MESSAGE_25_2,
#define NMT_MESSAGE_26 39 NMT_MESSAGE_25_3,
#define NMT_MESSAGE_27 40 NMT_MESSAGE_25_4,
#define NMT_MESSAGE_28 41 NMT_MESSAGE_26,
#define NMT_MESSAGE_30 42 NMT_MESSAGE_27,
NMT_MESSAGE_28,
NMT_MESSAGE_30,
NMT_MESSAGE_UKN_MTX,
NMT_MESSAGE_UKN_B,
};
typedef struct frame { typedef struct frame {
uint8_t index; uint8_t index;
uint16_t channel_no; uint16_t channel_no;
@@ -66,6 +71,8 @@ typedef struct frame {
uint64_t sres; uint64_t sres;
uint16_t limit_strength_eval; uint16_t limit_strength_eval;
uint16_t c; uint16_t c;
uint8_t seq_number;
uint16_t checksum;
} frame_t; } frame_t;
int init_frame(void); int init_frame(void);

View File

@@ -323,7 +323,11 @@ int main(int argc, char *argv[])
return -1; return -1;
} }
} }
init_frame(); rc = init_frame();
if (rc < 0) {
fprintf(stderr, "Failed to setup frames. Quitting!\n");
return -1;
}
dsp_init(); dsp_init();
rc = call_init(station_id, call_sounddev, samplerate, latency, 7, loopback); rc = call_init(station_id, call_sounddev, samplerate, latency, 7, loopback);
if (rc < 0) { if (rc < 0) {