mirror of
				https://github.com/brmlab/osmo-tetra.git
				synced 2025-10-30 23:14:00 +01:00 
			
		
		
		
	add decode of CMCE PDU type
This commit is contained in:
		
							parent
							
								
									f91f994300
								
							
						
					
					
						commit
						c3ba1f39df
					
				
					 4 changed files with 122 additions and 1 deletions
				
			
		|  | @ -9,7 +9,7 @@ all: conv_enc_test crc_test tetra-rx float_to_bits | ||||||
| libosmo-tetra-phy.a: phy/tetra_burst_sync.o phy/tetra_burst.o | libosmo-tetra-phy.a: phy/tetra_burst_sync.o phy/tetra_burst.o | ||||||
| 	$(AR) r $@ $^ | 	$(AR) r $@ $^ | ||||||
| 
 | 
 | ||||||
| libosmo-tetra-mac.a: lower_mac/tetra_conv_enc.o tetra_tdma.o lower_mac/tetra_scramb.o lower_mac/tetra_rm3014.o lower_mac/tetra_interleave.o lower_mac/crc_simple.o tetra_common.o lower_mac/viterbi.o lower_mac/viterbi_cch.o lower_mac/viterbi_tch.o lower_mac/tetra_lower_mac.o tetra_upper_mac.o tetra_mac_pdu.o tetra_mle_pdu.o tetra_mm_pdu.o tetra_gsmtap.o | libosmo-tetra-mac.a: lower_mac/tetra_conv_enc.o tetra_tdma.o lower_mac/tetra_scramb.o lower_mac/tetra_rm3014.o lower_mac/tetra_interleave.o lower_mac/crc_simple.o tetra_common.o lower_mac/viterbi.o lower_mac/viterbi_cch.o lower_mac/viterbi_tch.o lower_mac/tetra_lower_mac.o tetra_upper_mac.o tetra_mac_pdu.o tetra_mle_pdu.o tetra_mm_pdu.o tetra_cmce_pdu.o tetra_gsmtap.o | ||||||
| 	$(AR) r $@ $^ | 	$(AR) r $@ $^ | ||||||
| 
 | 
 | ||||||
| float_to_bits: float_to_bits.o | float_to_bits: float_to_bits.o | ||||||
|  |  | ||||||
							
								
								
									
										69
									
								
								src/tetra_cmce_pdu.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								src/tetra_cmce_pdu.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,69 @@ | ||||||
|  | /* Implementation of TETRA CMCE PDU parsing */ | ||||||
|  | 
 | ||||||
|  | /* (C) 2011 by Harald Welte <laforge@gnumonks.org>
 | ||||||
|  |  * All Rights Reserved | ||||||
|  |  * | ||||||
|  |  * This program is free software; you can redistribute it and/or modify | ||||||
|  |  * it under the terms of the GNU Affero General Public License as published by | ||||||
|  |  * the Free Software Foundation; either version 3 of the License, or | ||||||
|  |  * (at your option) any later version. | ||||||
|  |  * | ||||||
|  |  * This program is distributed in the hope that it will be useful, | ||||||
|  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
|  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||||
|  |  * GNU Affero General Public License for more details. | ||||||
|  |  * | ||||||
|  |  * You should have received a copy of the GNU Affero General Public License | ||||||
|  |  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | #include <unistd.h> | ||||||
|  | #include <osmocom/core/utils.h> | ||||||
|  | 
 | ||||||
|  | #include "tetra_cmce_pdu.h" | ||||||
|  | 
 | ||||||
|  | static const struct value_string cmce_pdut_d_names[] = { | ||||||
|  | 	{ TCMCE_PDU_T_D_ALERT,		"D-ALERT" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_CALL_PROCEEDING,"D-CALL PROCEEDING" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_CONNECT,	"D-CONNECT" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_CONNECT_ACK,	"D-CONNECT ACK" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_DISCONNECT,	"D-DISCONNECT" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_INFO,		"D-INFO" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_RELEASE,	"D-RELEASE" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_SETUP,		"D-SETUP" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_STATUS,		"D-STATUS" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_TX_CEASED,	"D-TX CEASED" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_TX_CONTINUE,	"D-TX CONTINUE" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_TX_GRANTED,	"D-TX GRANTED" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_TX_WAIT,	"D-TX WAIT" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_TX_INTERRUPT,	"D-TX INTERRUPT" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_CALL_RESTORE,	"D-TX CALL RESTORE" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_SDS_DATA,	"D-SDS DATA" }, | ||||||
|  | 	{ TCMCE_PDU_T_D_FACILITY,	"D-FACILITY" }, | ||||||
|  | 	{ 0, NULL } | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | static const struct value_string cmce_pdut_u_names[] = { | ||||||
|  | 	{ TCMCE_PDU_T_U_ALERT,		"U-ALERT" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_CONNECT,	"U-CONNECT" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_DISCONNECT,	"U-DISCONNECT" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_INFO,		"U-INFO" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_RELEASE,	"U-RELEASE" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_SETUP,		"U-SETUP" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_STATUS,		"U-STATUS" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_TX_CEASED,	"U-TX CEASED" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_TX_DEMAND,	"U-TX DEMAND" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_CALL_RESTORE,	"U-TX CALL RESTORE" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_SDS_DATA,	"U-SDS DATA" }, | ||||||
|  | 	{ TCMCE_PDU_T_U_FACILITY,	"U-FACILITY" }, | ||||||
|  | 	{ 0, NULL } | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const char *tetra_get_cmce_pdut_name(uint16_t pdut, int uplink) | ||||||
|  | { | ||||||
|  | 	if (uplink == 0) | ||||||
|  | 		return get_value_string(cmce_pdut_d_names, pdut); | ||||||
|  | 	else | ||||||
|  | 		return get_value_string(cmce_pdut_u_names, pdut); | ||||||
|  | } | ||||||
							
								
								
									
										48
									
								
								src/tetra_cmce_pdu.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/tetra_cmce_pdu.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,48 @@ | ||||||
|  | #ifndef TETRA_CMCE_PDU_H | ||||||
|  | #define TETRA_CMCE_PDU_H | ||||||
|  | 
 | ||||||
|  | #include <stdint.h> | ||||||
|  | 
 | ||||||
|  | /* 14.8.28 */ | ||||||
|  | enum tetra_cmce_pdu_type_d { | ||||||
|  | 	TCMCE_PDU_T_D_ALERT		= 0x00, | ||||||
|  | 	TCMCE_PDU_T_D_CALL_PROCEEDING	= 0x01, | ||||||
|  | 	TCMCE_PDU_T_D_CONNECT		= 0x02, | ||||||
|  | 	TCMCE_PDU_T_D_CONNECT_ACK	= 0x03, | ||||||
|  | 	TCMCE_PDU_T_D_DISCONNECT	= 0x04, | ||||||
|  | 	TCMCE_PDU_T_D_INFO		= 0x05, | ||||||
|  | 	TCMCE_PDU_T_D_RELEASE		= 0x06, | ||||||
|  | 	TCMCE_PDU_T_D_SETUP		= 0x07, | ||||||
|  | 	TCMCE_PDU_T_D_STATUS		= 0x08, | ||||||
|  | 	TCMCE_PDU_T_D_TX_CEASED		= 0x09, | ||||||
|  | 	TCMCE_PDU_T_D_TX_CONTINUE	= 0x0a, | ||||||
|  | 	TCMCE_PDU_T_D_TX_GRANTED	= 0x0b, | ||||||
|  | 	TCMCE_PDU_T_D_TX_WAIT		= 0x0c, | ||||||
|  | 	TCMCE_PDU_T_D_TX_INTERRUPT	= 0x0d, | ||||||
|  | 	TCMCE_PDU_T_D_CALL_RESTORE	= 0x0e, | ||||||
|  | 	TCMCE_PDU_T_D_SDS_DATA		= 0x0f, | ||||||
|  | 	TCMCE_PDU_T_D_FACILITY		= 0x10, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | enum tetra_cmce_pdu_type_u { | ||||||
|  | 	TCMCE_PDU_T_U_ALERT		= 0x00, | ||||||
|  | 	/* reserved */ | ||||||
|  | 	TCMCE_PDU_T_U_CONNECT		= 0x02, | ||||||
|  | 	/* reserved */ | ||||||
|  | 	TCMCE_PDU_T_U_DISCONNECT	= 0x04, | ||||||
|  | 	TCMCE_PDU_T_U_INFO		= 0x05, | ||||||
|  | 	TCMCE_PDU_T_U_RELEASE		= 0x06, | ||||||
|  | 	TCMCE_PDU_T_U_SETUP		= 0x07, | ||||||
|  | 	TCMCE_PDU_T_U_STATUS		= 0x08, | ||||||
|  | 	TCMCE_PDU_T_U_TX_CEASED		= 0x09, | ||||||
|  | 	TCMCE_PDU_T_U_TX_DEMAND		= 0x0a, | ||||||
|  | 	/*reserved*/ | ||||||
|  | 	TCMCE_PDU_T_U_CALL_RESTORE	= 0x0e, | ||||||
|  | 	TCMCE_PDU_T_U_SDS_DATA		= 0x0f, | ||||||
|  | 	TCMCE_PDU_T_U_FACILITY		= 0x10, | ||||||
|  | 	/*reserved*/ | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const char *tetra_get_cmce_pdut_name(uint16_t pdut, int uplink); | ||||||
|  | 
 | ||||||
|  | #endif /* TETRA_CMCE_PDU_H */ | ||||||
|  | @ -31,6 +31,7 @@ | ||||||
| #include "tetra_mac_pdu.h" | #include "tetra_mac_pdu.h" | ||||||
| #include "tetra_mle_pdu.h" | #include "tetra_mle_pdu.h" | ||||||
| #include "tetra_mm_pdu.h" | #include "tetra_mm_pdu.h" | ||||||
|  | #include "tetra_cmce_pdu.h" | ||||||
| #include "tetra_gsmtap.h" | #include "tetra_gsmtap.h" | ||||||
| 
 | 
 | ||||||
| static void rx_bcast(struct tetra_tmvsap_prim *tmvp) | static void rx_bcast(struct tetra_tmvsap_prim *tmvp) | ||||||
|  | @ -90,6 +91,9 @@ static int rx_tm_sdu(uint8_t *bits, unsigned int len) | ||||||
| 	case TMLE_PDISC_MM: | 	case TMLE_PDISC_MM: | ||||||
| 		printf(" %s", tetra_get_mm_pdut_name(bits_to_uint(bits+3, 4), 0)); | 		printf(" %s", tetra_get_mm_pdut_name(bits_to_uint(bits+3, 4), 0)); | ||||||
| 		break; | 		break; | ||||||
|  | 	case TMLE_PDISC_CMCE: | ||||||
|  | 		printf(" %s", tetra_get_cmce_pdut_name(bits_to_uint(bits+3, 5), 0)); | ||||||
|  | 		break; | ||||||
| 	default: | 	default: | ||||||
| 		break; | 		break; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Harald Welte
						Harald Welte