libosmogsm
0.11.0-dirty
Osmocom GSM library
|
00001 00003 #pragma once 00004 00005 #include <stdint.h> 00006 #include <osmocom/core/endian.h> 00007 #include <osmocom/core/utils.h> 00008 00009 /* According to 3GPP TS 44.014 / GSM TS 04.14 */ 00010 00011 #define GSM414_MT_CLOSE_TCH_LOOP_CMD 0x00 /* 8.1 */ 00012 enum gsm414_tch_loop_mode { 00013 GSM414_LOOP_A = 0x00, 00014 GSM414_LOOP_B = 0x01, 00015 GSM414_LOOP_C = 0x02, 00016 GSM414_LOOP_D = 0x04, 00017 GSM414_LOOP_E = 0x08, 00018 GSM414_LOOP_F = 0x0c, 00019 GSM414_LOOP_I = 0x1c, 00020 }; 00021 00022 #define GSM414_MT_CLOSE_TCH_LOOP_ACK 0x01 /* 8.2 */ 00023 #define GSM414_MT_OPEN_LOOP_CMD 0x02 /* 8.3 */ 00024 #define GSM414_OPEN_LOOP_ACK_IE 0x81 00025 00026 #define GSM414_MT_CLOSE_MSLOT_LOOP_CMD 0x20 /* 8.4 */ 00027 struct gsm414_close_mslot_loop_cmd { 00028 #if OSMO_IS_LITTLE_ENDIAN == 1 00029 uint8_t chc:2, 00030 loop_mech:3, 00031 tn:3; 00032 #else 00033 uint8_t tn:3, 00034 loop_mech:3, 00035 chc:2; 00036 #endif 00037 } __attribute__((packed)); 00038 00039 #define GSM414_MT_CLOSE_MSLOT_LOOP_ACK 0x21 /* 8.5 */ 00040 struct gsm414_close_mslot_loop_ack { 00041 #if OSMO_IS_LITTLE_ENDIAN == 1 00042 uint8_t err_ind:1, 00043 loop_mech:3, 00044 chc:2, 00045 spare:2; 00046 #else 00047 uint8_t spare:2, 00048 chc:2, 00049 loop_mech:3, 00050 err_ind:1; 00051 #endif 00052 } __attribute__((packed)); 00053 00054 #define GSM414_MT_OPEN_MSLOT_LOOP_CMD 0x22 /* 8.6 */ 00055 #define GSM414_MT_OPEN_MSLOT_LOOP_ACK 0x23 /* 8.7 */ 00056 #define GSM414_MT_ACT_EMMI_CMD 0x0c /* 8.8 */ 00057 #define GSM414_MT_ACT_EMMI_ACK 0x0d /* 8.9 */ 00058 #define GSM414_MT_DEACT_EMMI_CMD 0x80 /* 8.10 */ 00059 #define GSM414_MT_TEST_INTERFACE 0x84 /* 8.11 */ 00060 00061 /* 8.12 Timers (milli-seconds) */ 00062 #define GSM414_TT01_MS 2500 00063 #define GSM414_TT02_MS 2500 00064 #define GSM414_TT03_MS 50 00065 00066 #define GSM414_MT_GPRS_TEST_MODE_CMD 0x24 /* 8.13 */ 00067 struct gsm414_gprs_test_mode_cmd { 00068 #if OSMO_IS_LITTLE_ENDIAN == 1 00069 uint16_t d:12, 00070 spare:3, 00071 l:1; 00072 uint8_t m:1, 00073 dl_tx_offset:3, 00074 _spare:4; 00075 #else 00076 uint16_t l:1, 00077 spare:3, 00078 d:12; 00079 uint8_t _spare:4, 00080 dl_tx_offset:3, 00081 m:1; 00082 #endif 00083 } __attribute__((packed)); 00084 00085 00086 #define GSM414_MT_EGPRS_ST_RB_LOOP_CMD 0x25 /* 8.14 */ 00087 struct gsm414_egprs_st_sb_loop_cmd { 00088 #if OSMO_IS_LITTLE_ENDIAN == 1 00089 uint8_t _spare:4, 00090 dl_tx_offset:3, 00091 m:1; 00092 #else 00093 uint8_t m:1, 00094 dl_tx_offset:3, 00095 _spare:4; 00096 #endif 00097 } __attribute__((packed)); 00098 00099 #define GSM414_MT_RESET_MS_POS_STORED 0x26 /* 8.15 */ 00100 #define GSM414_MS_POS_TECH_AGPS 0x00 00101 #define GSM414_MS_POS_TECH_AGNSS 0x01 00102 00103 extern const struct value_string gsm414_msgt_names[];