diff options
author | Chris Bontje <cbontje@gmail.com> | 2017-02-21 12:54:58 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-02-22 04:37:10 +0000 |
commit | 882fa722c02059ed5d59d77a5e3a5d6578eed828 (patch) | |
tree | 5019051d72ff740c181b4c7f7a94065a1f71ca90 /epan/dissectors/packet-lg8979.c | |
parent | c1ab23d64b3276fec5e3a33a4fa945067bac77e1 (diff) |
L&G 8979 - Fix 'flags' display and RTU->master echoed responses from SBO commands
Change-Id: I7bf8ce24ded164d547c739b00299f292bc4237cf
Reviewed-on: https://code.wireshark.org/review/20233
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-lg8979.c')
-rw-r--r-- | epan/dissectors/packet-lg8979.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/epan/dissectors/packet-lg8979.c b/epan/dissectors/packet-lg8979.c index 30e75f7d76..e2fbf1480f 100644 --- a/epan/dissectors/packet-lg8979.c +++ b/epan/dissectors/packet-lg8979.c @@ -1124,6 +1124,45 @@ dissect_lg8979(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ break; + /* Function Code 21 SBO Select - Echo of Master->RTU Message */ + case LG8979_FC_SBO_SELECT: + + /* Get 8-bit point number and trip/close command-code */ + ptnum = tvb_get_guint8(tvb, offset); + tripclose = (tvb_get_guint8(tvb, offset+1) & 0x80) >> 7; + + lg8979_point_tree = proto_tree_add_subtree_format( + lg8979_tree, tvb, offset, 2, + ett_lg8979_point, NULL, + "SBO Command, Pt.Num: %u, Code: %s", + ptnum, + val_to_str_const(tripclose, lg8979_sbo_tripclose_vals, "Unknown Control Code")); + + /* Update the Information Column with Command Details */ + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Output: %u, Code: %s", + ptnum, val_to_str_const(tripclose, lg8979_sbo_tripclose_vals, "Unknown Control Code")); + + /* Add SBO Select Details to tree */ + proto_tree_add_item(lg8979_point_tree, hf_lg8979_start_ptnum8, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(lg8979_point_tree, hf_lg8979_sbo_tripclose, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(lg8979_point_tree, hf_lg8979_sbo_timercnt, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); + offset += 2; + break; + + /* Function Code 22 SBO Operate - Echo of Master->RTU Message */ + case LG8979_FC_SBO_OPERATE: + + /* Get 8-bit point number */ + ptnum = tvb_get_guint8(tvb, offset); + + /* Update the Information Column with Command Details */ + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Output: %u", ptnum); + + /* Add 8-bit point number to tree */ + proto_tree_add_item(lg8979_tree, hf_lg8979_start_ptnum8, tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset += 1; + break; + /* Function Code 31 RTU Configuration */ case LG8979_FC_RTU_CONFIG: @@ -1266,7 +1305,7 @@ proto_register_lg8979(void) { &hf_lg8979_header, { "Header", "lg8979.header", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_lg8979_flags, - { "Flags", "lg8979.flags", FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }}, + { "Flags", "lg8979.flags", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, { &hf_lg8979_shr, { "SHR", "lg8979.shr", FT_UINT8, BASE_DEC, NULL, 0x80, "Short Response Flag", HFILL }}, { &hf_lg8979_mfc, |