Răsfoiți Sursa

Add dissector for EPS TC - 211, TM -211, 212

priyadharsan 2 luni în urmă
părinte
comite
263f51ab35

+ 17 - 0
Dissector/tc_eps_set_cntrl_chnl_state.lua

@@ -0,0 +1,17 @@
+function tc_eps_set_cntrl_chnl_state(buffer, pinfo, tree, eps_ctrl_chnl, offset)
+
+local f_ch_no = ProtoField.uint8("eps_ctrl_chnl.ch_no", "Channel Number", base.DEC)
+local f_ch_st = ProtoField.uint8("eps_ctrl_chnl.ch_st", "Channel State", base.DEC)
+
+-- Add the fields to the protocol
+eps_ctrl_chnl.fields = {f_ch_no, f_ch_st}
+
+local subtree = tree:add(eps_ctrl_chnl, buffer(), "TC_SET_EPS_CTRL_CHNL_ST")
+
+    subtree:add(f_ch_no, buffer(offset, 1)) -- First byte: Channel Number
+    offset = offset + 1
+    
+    subtree:add(f_ch_st, buffer(offset, 1)) -- Second byte: Channel State
+    offset = offset + 1
+    
+end

+ 29 - 0
Dissector/tm_eps_set_cntrl_chnl_state.lua

@@ -0,0 +1,29 @@
+function tm_eps_set_cntrl_chnl_state(buffer, pinfo, tree, tm_eps_ctrl_chnl, offset)
+
+local f_scs_fail_status = ProtoField.uint8("tm_eps_ctrl_chnl.scs_fail_status", "Scs/Fail Status", base.DEC, {
+    [0] = "EPS_CTRL_SUCCESS",
+    [1] = "EPS_CTRL_COMM_ERR",
+    [2] = "EPS_CTRL_PARAM_ERR",
+    [3] = "EPS_CTRL_HW_ERR",
+    [4] = "EPS_CTRL_ERR",
+    [5] = "EPS_CTRL_BTRY_ERR",
+    [6] = "EPS_CTRL_IN_PROG",
+    [7] = "EPS_CTRL_FW_MISMATCH_ERR",
+    [8] = "EPS_CTRL_CHNL_OVR_CUR_ERR",
+    [9] = "EPS_CTRL_INVLD_CHNL"
+})
+local f_channel_number = ProtoField.uint8("tm_eps_ctrl_chnl.channel_number", "Channel Number", base.DEC)
+local f_channel_state = ProtoField.uint8("tm_eps_ctrl_chnl.channel_state", "Channel State", base.DEC)
+
+tm_eps_ctrl_chnl.fields = {f_scs_fail_status, f_channel_number, f_channel_state}
+
+local subtree = tree:add(tm_eps_ctrl_chnl, buffer(), "TM SET EPS CTRL CHNL ST")
+
+
+    subtree:add(f_scs_fail_status, buffer(offset, 1)) -- Byte 0: Scs/Fail Status
+    offset = offset + 1
+    subtree:add(f_channel_number, buffer(offset, 1)) -- Byte 1: Channel Number
+    offset = offset + 1
+    subtree:add(f_channel_state, buffer(offset, 1)) -- Byte 2: Channel State
+    offset = offset + 1
+end

+ 41 - 0
Dissector/tm_get_eps_dev_hw_sts.lua

@@ -0,0 +1,41 @@
+function tm_get_eps_dev_hw_sts(buffer, pinfo, tree, tm_eps_ctrl_chnl, offset)
+
+local f_scs_fail_status = ProtoField.uint8("tm_eps_ctrl_chnl.scs_fail_status", "Scs/Fail Status", base.DEC, {
+    [0] = "Success",
+    [1] = "Fail"
+})
+
+local status =
+{
+  "OFF",
+  "ON",
+  "RESTART",
+  "BOOT",
+  "SHUTDOWN",
+  "ERROR"
+}
+
+local f_channel_hw_sts = ProtoField.uint8("tm_eps_ctrl_chnl.channel_hw_sts", "Channel HW Status", base.DEC)
+local f_channel_sw_sts = ProtoField.uint8("tm_eps_ctrl_chnl.channel_sw_sts", "Channel SW Status", base.DEC)
+
+-- Add the fields to the protocol
+tm_eps_ctrl_chnl.fields = {f_scs_fail_status, f_channel_hw_sts, f_channel_sw_sts}
+
+local subtree = tree:add(tm_eps_ctrl_chnl, buffer(), "TM GET EPS DEV HW STS")
+
+    subtree:add(f_scs_fail_status, buffer(offset, 1)) -- Byte 0: Scs/Fail Status
+    offset = offset + 1
+
+    -- Parse and add channel statuses
+
+    for i = 0, 28 do -- There are 29 channels, each with 2 bytes (HW + SW)
+        
+        subtree:add(buffer(offset, 2), string.format("Channel %d Status", i))
+        local hw_sts = buffer(offset, 1):le_uint()
+        subtree:add(f_channel_hw_sts, hw_sts):set_text(string.format("Channel HW status : %s",status[hw_sts + 1])) -- HW Status
+        offset = offset + 1
+        local sw_sts = buffer(offset, 1):le_uint()
+        subtree:add(f_channel_sw_sts, sw_sts):set_text(string.format("Channel SW status : %s",status[sw_sts + 1]))-- SW Status
+        offset = offset + 1
+    end
+end

+ 42 - 42
Dissector/tm_sband_get_device_conf.lua

@@ -2,28 +2,28 @@
 function tm_sband_get_device_conf(buffer, pinfo, tree, tm_sband_get_device_conf, offset)
 
 -- Define ProtoFields with three arguments
-local f_rfe_rx0_on = ProtoField.uint32("tm_sband_get_device_conf.RfeRx0On", "RFE RX0 On", base.HEX)
-local f_rfe_tx0_on = ProtoField.uint32("tm_sband_get_device_conf.RfeTx0On", "RFE TX0 On", base.HEX)
-local f_rfe_pa0_on = ProtoField.uint32("tm_sband_get_device_conf.RfePa0On", "RFE PA0 On", base.HEX)
-local f_rfe_rx_tx0 = ProtoField.uint32("tm_sband_get_device_conf.RfeRxTx0", "RFE RX TX0", base.HEX)
-local f_rfe_rx1_on = ProtoField.uint32("tm_sband_get_device_conf.RfeRx1On", "RFE RX1 On", base.HEX)
-local f_rfe_tx1_on = ProtoField.uint32("tm_sband_get_device_conf.RfeTx1On", "RFE TX1 On", base.HEX)
-local f_rfe_pa1_on = ProtoField.uint32("tm_sband_get_device_conf.RfePa1On", "RFE PA1 On", base.HEX)
-local f_rfe_rx_tx1 = ProtoField.uint32("tm_sband_get_device_conf.RfeRxTx1", "RFE RX TX1", base.HEX)
-local f_rfe_out_en = ProtoField.uint32("tm_sband_get_device_conf.RfeOutEn", "RFE Out Enable", base.HEX)
-local f_rfe_gpio0 = ProtoField.uint32("tm_sband_get_device_conf.RfeGpio0", "RFE GPIO0", base.HEX)
-local f_rfe_loop_det = ProtoField.uint32("tm_sband_get_device_conf.RfeLoopDet", "RFE Loop Detect", base.HEX)
-local f_rfe_lo_mux = ProtoField.uint32("tm_sband_get_device_conf.RfeLoMux", "RFE LO Mux", base.HEX)
-local f_rfe_pow_on = ProtoField.uint32("tm_sband_get_device_conf.RfePowOn", "RFE Power On", base.HEX)
-local f_rfe_da = ProtoField.uint32("tm_sband_get_device_conf.RfeDA", "RFE DA", base.HEX)
-local f_rfe_cl = ProtoField.uint32("tm_sband_get_device_conf.RfeCL", "RFE CL", base.HEX)
-local f_rfe_en_ad5304 = ProtoField.uint32("tm_sband_get_device_conf.RfeEnAD5304", "RFE Enable AD5304", base.HEX)
-local f_rfe_en_synth = ProtoField.uint32("tm_sband_get_device_conf.RfeEnSynth", "RFE Enable Synthesizer", base.HEX)
-local f_rfe_en3 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn3", "RFE Enable 3", base.HEX)
-local f_rfe_en4 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn4", "RFE Enable 4", base.HEX)
-local f_rfe_en5 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn5", "RFE Enable 5", base.HEX)
-local f_rfe_7v0_en = ProtoField.uint32("tm_sband_get_device_conf.Rfe7V0En", "RFE 7V0 Enable", base.HEX)
-local f_rfe_rsv_uint32 = ProtoField.uint32("tm_sband_get_device_conf.RfeRsvuint32", "Reserved Bits", base.HEX)
+local f_rfe_rx0_on = ProtoField.uint32("tm_sband_get_device_conf.RfeRx0On", "RFE RX0 On", base.DEC)
+local f_rfe_tx0_on = ProtoField.uint32("tm_sband_get_device_conf.RfeTx0On", "RFE TX0 On", base.DEC)
+local f_rfe_pa0_on = ProtoField.uint32("tm_sband_get_device_conf.RfePa0On", "RFE PA0 On", base.DEC)
+local f_rfe_rx_tx0 = ProtoField.uint32("tm_sband_get_device_conf.RfeRxTx0", "RFE RX TX0", base.DEC)
+local f_rfe_rx1_on = ProtoField.uint32("tm_sband_get_device_conf.RfeRx1On", "RFE RX1 On", base.DEC)
+local f_rfe_tx1_on = ProtoField.uint32("tm_sband_get_device_conf.RfeTx1On", "RFE TX1 On", base.DEC)
+local f_rfe_pa1_on = ProtoField.uint32("tm_sband_get_device_conf.RfePa1On", "RFE PA1 On", base.DEC)
+local f_rfe_rx_tx1 = ProtoField.uint32("tm_sband_get_device_conf.RfeRxTx1", "RFE RX TX1", base.DEC)
+local f_rfe_out_en = ProtoField.uint32("tm_sband_get_device_conf.RfeOutEn", "RFE Out Enable", base.DEC)
+local f_rfe_gpio0 = ProtoField.uint32("tm_sband_get_device_conf.RfeGpio0", "RFE GPIO0", base.DEC)
+local f_rfe_loop_det = ProtoField.uint32("tm_sband_get_device_conf.RfeLoopDet", "RFE Loop Detect", base.DEC)
+local f_rfe_lo_mux = ProtoField.uint32("tm_sband_get_device_conf.RfeLoMux", "RFE LO Mux", base.DEC)
+local f_rfe_pow_on = ProtoField.uint32("tm_sband_get_device_conf.RfePowOn", "RFE Power On", base.DEC)
+local f_rfe_da = ProtoField.uint32("tm_sband_get_device_conf.RfeDA", "RFE DA", base.DEC)
+local f_rfe_cl = ProtoField.uint32("tm_sband_get_device_conf.RfeCL", "RFE CL", base.DEC)
+local f_rfe_en_ad5304 = ProtoField.uint32("tm_sband_get_device_conf.RfeEnAD5304", "RFE Enable AD5304", base.DEC)
+local f_rfe_en_synth = ProtoField.uint32("tm_sband_get_device_conf.RfeEnSynth", "RFE Enable Synthesizer", base.DEC)
+local f_rfe_en3 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn3", "RFE Enable 3", base.DEC)
+local f_rfe_en4 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn4", "RFE Enable 4", base.DEC)
+local f_rfe_en5 = ProtoField.uint32("tm_sband_get_device_conf.RfeEn5", "RFE Enable 5", base.DEC)
+local f_rfe_7v0_en = ProtoField.uint32("tm_sband_get_device_conf.Rfe7V0En", "RFE 7V0 Enable", base.DEC)
+local f_rfe_rsv_uint32 = ProtoField.uint32("tm_sband_get_device_conf.RfeRsvuint32", "Reserved Bits", base.DEC)
 
 local f_rxmix_ch0 = ProtoField.int32("tm_sband_get_device_conf.rxmix_ch0", "receive DownConversionFrequency channel 0", base.DEC)
 local f_rxmix_ch1 = ProtoField.int32("tm_sband_get_device_conf.rxmix_ch1", "receive DownConversionFrequency channel 1", base.DEC)
@@ -140,64 +140,64 @@ tm_sband_get_device_conf.fields = {
     subtree:add(f_rfe_tx0_on, value)
     
     value = (data >> 2) & 1
-    subtree:add(f_rfe_pa0_on, data)
+    subtree:add(f_rfe_pa0_on, value)
     
     value = (data >> 3) & 1
-    subtree:add(f_rfe_rx_tx0, data)
+    subtree:add(f_rfe_rx_tx0, value)
     
     value = (data >> 4) & 1
-    subtree:add(f_rfe_rx1_on, data)
+    subtree:add(f_rfe_rx1_on, value)
     
     value = (data >> 5) & 1
-    subtree:add(f_rfe_tx1_on, data)
+    subtree:add(f_rfe_tx1_on, value)
     
     value = (data >> 6) & 1
-    subtree:add(f_rfe_pa1_on, data)
+    subtree:add(f_rfe_pa1_on, value)
     
     value = (data >> 7) & 1
-    subtree:add(f_rfe_rx_tx1, data)
+    subtree:add(f_rfe_rx_tx1, value)
     
     value = (data >> 8) & 1
-    subtree:add(f_rfe_out_en, data)
+    subtree:add(f_rfe_out_en, value)
     
     value = (data >> 9) & 1
-    subtree:add(f_rfe_gpio0, data)
+    subtree:add(f_rfe_gpio0, value)
     
     value = (data >> 10) & 1
-    subtree:add(f_rfe_loop_det, data)
+    subtree:add(f_rfe_loop_det, value)
     
     value = (data >> 11) & 1
-    subtree:add(f_rfe_lo_mux, data)
+    subtree:add(f_rfe_lo_mux, value)
     
     value = (data >> 12) & 1
-    subtree:add(f_rfe_pow_on, data)
+    subtree:add(f_rfe_pow_on, value)
     
     value = (data >> 13) & 1
-    subtree:add(f_rfe_da, data)
+    subtree:add(f_rfe_da, value)
     
     value = (data >> 14) & 1
-    subtree:add(f_rfe_cl, data)
+    subtree:add(f_rfe_cl, value)
     
     value = (data >> 15) & 1
-    subtree:add(f_rfe_en_ad5304, data)
+    subtree:add(f_rfe_en_ad5304, value)
     
     value = (data >> 16) & 1
-    subtree:add(f_rfe_en_synth, data)
+    subtree:add(f_rfe_en_synth, value)
     
     value = (data >> 17) & 1
-    subtree:add(f_rfe_en3, data)
+    subtree:add(f_rfe_en3, value)
     
     value = (data >> 18) & 1
-    subtree:add(f_rfe_en4, data)
+    subtree:add(f_rfe_en4, value)
     
     value = (data >> 19) & 1
-    subtree:add(f_rfe_en5, data)
+    subtree:add(f_rfe_en5, value)
     
     value = (data >> 20) & 1
-    subtree:add(f_rfe_7v0_en, data)
+    subtree:add(f_rfe_7v0_en, value)
     
     value = (data >> 21) & 0xfff3
-    subtree:add(f_rfe_rsv_uint32, data)
+    subtree:add(f_rfe_rsv_uint32, value)
     
     
     offset = offset + 4

BIN
exo_dissector_lua.zip