mirror of
				https://github.com/brmlab/osmo-tetra.git
				synced 2025-10-31 07:24:01 +01:00 
			
		
		
		
	upper mac: fix printing of carrier frequency Hz
This commit is contained in:
		
							parent
							
								
									51147d4e7a
								
							
						
					
					
						commit
						2c6eab8f48
					
				
					 1 changed files with 14 additions and 3 deletions
				
			
		|  | @ -36,6 +36,9 @@ | |||
| #include "tetra_mle_pdu.h" | ||||
| #include "tetra_gsmtap.h" | ||||
| 
 | ||||
| /* FIXME: this is ugly */ | ||||
| static struct tetra_si_decoded g_last_sid; | ||||
| 
 | ||||
| static void rx_bcast(struct tetra_tmvsap_prim *tmvp) | ||||
| { | ||||
| 	struct tmv_unitdata_param *tup = &tmvp->u.unitdata; | ||||
|  | @ -67,19 +70,27 @@ static void rx_bcast(struct tetra_tmvsap_prim *tmvp) | |||
| 		printf("\t%s: %u\n", tetra_get_bs_serv_det_name(1 << i), | ||||
| 			sid.mle_si.bs_service_details & (1 << i) ? 1 : 0); | ||||
| 
 | ||||
| 	memcpy(&g_last_sid, &sid, sizeof(sid)); | ||||
| } | ||||
| 
 | ||||
| const char *tetra_alloc_dump(const struct tetra_chan_alloc_decoded *cad) | ||||
| { | ||||
| 	static char buf[64]; | ||||
| 	char *cur = buf; | ||||
| 	unsigned int freq_band, freq_offset; | ||||
| 
 | ||||
| 	if (cad->ext_carr_pres) { | ||||
| 		freq_band = cad->ext_carr.freq_band; | ||||
| 		freq_offset = cad->ext_carr.freq_offset; | ||||
| 	} else { | ||||
| 		freq_band = g_last_sid.freq_band; | ||||
| 		freq_offset = g_last_sid.freq_offset; | ||||
| 	} | ||||
| 
 | ||||
| 	cur += sprintf(cur, "%s (TN%u/%s/%uHz)", | ||||
| 		tetra_get_alloc_t_name(cad->type), cad->timeslot, | ||||
| 		tetra_get_ul_dl_name(cad->ul_dl), | ||||
| 		/* FIXME: what if ext_carr_pres == 0? */ | ||||
| 		tetra_dl_carrier_hz(cad->ext_carr.freq_band, cad->carrier_nr, | ||||
| 				    cad->ext_carr.freq_offset)); | ||||
| 		tetra_dl_carrier_hz(freq_band, cad->carrier_nr, freq_offset)); | ||||
| 
 | ||||
| 	return buf; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Harald Welte
						Harald Welte