8484 'rst_cnt_total' / construct .Int8ul ,
8585 'rst_cnt_iwdg' / construct .Int8ul ,
8686 'adc_status' / construct .Hex (construct .Int8ul ),
87- 'adc_temp_1' / construct . Int16ul ,
88- 'adc_temp_2' / construct . Int16ul ,
87+ 'adc_temp_1' / temperature16u ,
88+ 'adc_temp_2' / temperature16u ,
8989 'ant_1_v' / voltage16u ,
9090 'ant_2_v' / voltage16u ,
9191 'solar_common_v' / voltage16u ,
220220 'command_seq_num' / construct .Int16ul ,
221221)
222222
223+ unknown = construct .Struct (
224+ '_name' / construct .Computed ('unknown' ),
225+ 'name' / construct .Computed ('Unknown' ),
226+
227+ 'data' / construct .Hex (construct .GreedyBytes ),
228+ )
229+
223230payloads = {
224231 CDM_VERSION_GET_ANS : cdm_version_get_ans ,
225232 CDM_TELEMETRY_GET_ANS_MOTHERBOARD : cdm_telemetry_get_ans_motherboard ,
234241trx_beacon = construct .Struct (
235242 'beacon_id' / construct .Int8ul ,
236243 'beacon_uptime' / common .TimeDeltaAdapter (construct .Int32ul ),
237- 'beacon_vbus' / common . LinearAdapter ( 1000 , construct . Int16ul ) ,
244+ 'beacon_vbus' / voltage16u ,
238245 'beacon_reset_total_cnt' / construct .Int8ul ,
239246 'beacon_reset_iwdg_cnt' / construct .Int8ul ,
240247 'beacon_reset_iwdg_time' / common .TimeDeltaAdapter (construct .Int32ul ),
241- 'beacon_pamp_temp' / common .LinearAdapter (100 , construct .Int16ul ),
248+ 'beacon_pamp_temp' / common .LinearAdapter (1000 , construct .Int16ul ),
242249 'beacon_rx_settings' / construct .Int8ul ,
243250 'beacon_rx_period_on' / construct .Int16ul ,
244251 'beacon_rx_seqnum' / construct .Int16ul ,
262269 'trx_beacon' / trx_beacon ,
263270 'cdm_datalen' / construct .Int8ul ,
264271 'cdm_header' / cdm_header ,
265- 'cdm_payload' / construct .Switch (construct .this .cdm_header .cdm_id , payloads , default = construct . GreedyBytes ),
272+ 'cdm_payload' / construct .Switch (construct .this .cdm_header .cdm_id , payloads , default = unknown ),
266273 '_tail' / construct .GreedyBytes ,
267274)
268275
@@ -485,6 +492,13 @@ class Cubebel2Protocol(common.Protocol):
485492 ('command_seq_num' , 'Command seq num' ),
486493 ),
487494 },
495+ 'unknown' : {
496+ 'table' : (
497+ * _beacon ,
498+ ('tlm_name' , 'Unknown' ),
499+ ('data' , 'Data' ),
500+ ),
501+ },
488502 }
489503
490504 def recognize (self , bb ):
@@ -497,6 +511,8 @@ def recognize(self, bb):
497511 _trx_beacon .pop ('_io' , 0 )
498512 _cdm_payload = {** data .frame .cdm_payload }
499513 _cdm_payload .pop ('_io' , 0 )
514+ if _cdm_payload ['_name' ] == 'unknown' :
515+ _cdm_payload ['data' ] = utils .bytes2hex (_cdm_payload ['data' ])
500516 d = utils .Dict (
501517 beacon_name = '' ,
502518 ** _trx_beacon ,
0 commit comments