summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas BERTIN <nicolas.bertin@al-enterprise.com>2017-04-19 22:37:04 +0200
committerMichael Mann <mmann78@netscape.net>2017-04-20 17:10:46 +0000
commit46f0c351a902284923a0d16bc394ceb91ebc8453 (patch)
tree6d8761a9c939f9dddc6ebe408ded4ba98f7180e7
parent7312019eac8d4c5546af1108f52155aa6efac0d4 (diff)
downloadwireshark-46f0c351a902284923a0d16bc394ceb91ebc8453.tar.gz
noe: reworked EVT_BT_KEY_... message handling
Change-Id: I36763e4f1b6bad6c7fd62100164a61a239653646 Reviewed-on: https://code.wireshark.org/review/21226 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-noe.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/epan/dissectors/packet-noe.c b/epan/dissectors/packet-noe.c
index 00f2068636..c4e71d8d72 100644
--- a/epan/dissectors/packet-noe.c
+++ b/epan/dissectors/packet-noe.c
@@ -602,7 +602,7 @@ static int hf_noe_property_item_u16 = -1;
static int hf_noe_property_item_u24 = -1;
static int hf_noe_property_item_u32 = -1;
static int hf_noe_property_item_bytes = -1;
-static int hf_event_value_u8 = -1;
+static int hf_event_bt_key = -1;
static int hf_event_context_switch = -1;
static int hf_evt_locappl_enable = -1;
static int hf_evt_locappl_interruptible= -1;
@@ -774,12 +774,6 @@ static const value_string str_key_name[] = {
};
static value_string_ext str_key_name_ext = VALUE_STRING_EXT_INIT(str_key_name);
-static const value_string noe_event_str_struct[] = {
- {0x00, "RJ9 Plug"},
- {0x01, "BT Handset Link"},
- {0, NULL}
- };
-
static const value_string noe_evt_context_switch_str_vals[] = {
{1, "Call Server"},
{2, "Presentation Server"},
@@ -1087,7 +1081,6 @@ static void decode_evt(proto_tree *tree,
guint offset,
guint length)
{
- proto_item *ti;
guint8 event = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_noe_event, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1107,11 +1100,7 @@ static void decode_evt(proto_tree *tree,
case OPCODE_EVT_BT_KEY_SHORTPRESS:
case OPCODE_EVT_BT_KEY_LONGPRESS:
case OPCODE_EVT_BT_KEY_VERYLONGPRESS:
- case OPCODE_EVT_KEY_LINE:
- case OPCODE_EVT_ONHOOK:
- case OPCODE_EVT_OFFHOOK:
- ti = proto_tree_add_item(tree, hf_event_value_u8, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_item_set_len(ti, length);
+ proto_tree_add_item(tree, hf_event_bt_key, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case OPCODE_EVT_KEY_PRESS:
case OPCODE_EVT_KEY_RELEASE:
@@ -1173,11 +1162,17 @@ static void decode_evt(proto_tree *tree,
proto_tree_add_item(tree, hf_evt_locappl_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
}
+ case OPCODE_EVT_KEY_LINE:
+ case OPCODE_EVT_ONHOOK:
+ case OPCODE_EVT_OFFHOOK:
case OPCODE_EVT_DEVICE_PRESENCE:
{
proto_tree_add_item(tree, hf_evt_dev_presence_value, tvb, offset, 1, ENC_BIG_ENDIAN);
- offset += 1;
- proto_tree_add_item(tree, hf_evt_dev_presence_state, tvb, offset, 1, ENC_BIG_ENDIAN);
+ if (OPCODE_EVT_DEVICE_PRESENCE == event)
+ {
+ offset += 1;
+ proto_tree_add_item(tree, hf_evt_dev_presence_state, tvb, offset, 1, ENC_BIG_ENDIAN);
+ }
break;
}
case OPCODE_EVT_SUCCESS_CREATE:
@@ -1615,13 +1610,13 @@ void proto_register_noe(void)
HFILL
}
},
- { &hf_event_value_u8,
+ { &hf_event_bt_key,
{
"Value",
- "noe.event_value.uint",
+ "noe.event_bt_key.value",
FT_UINT8,
BASE_DEC,
- VALS(noe_event_str_struct),
+ NULL,
0x0,
NULL,
HFILL