aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sbus.c
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-20 08:28:04 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-20 08:28:04 +0000
commit6ec8e0ced341862e9b8ddbf35f5ec54a2c30c1a4 (patch)
tree8201f6c5ac6c5c00d5e736f8719895d920fcb91a /epan/dissectors/packet-sbus.c
parentacf0f2cdb4cc67f699a071fb1a6910f1637a2902 (diff)
Use tvb_get_ephemeral_string() instead of tvb_get_string()
svn path=/trunk/; revision=29999
Diffstat (limited to 'epan/dissectors/packet-sbus.c')
-rw-r--r--epan/dissectors/packet-sbus.c510
1 files changed, 254 insertions, 256 deletions
diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c
index a73efc8739..694eb1d2df 100644
--- a/epan/dissectors/packet-sbus.c
+++ b/epan/dissectors/packet-sbus.c
@@ -1,5 +1,5 @@
/* packet-sbus.c
- * Routines for Ether-S-Bus dissection
+ * Routines for Ether-S-Bus dissection
* Copyright 2006, Christian Durrer <christian.durrer@sensemail.ch>
*
* $Id$
@@ -7,17 +7,17 @@
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -457,11 +457,11 @@ static GHashTable *sbus_request_hash = NULL;
static GMemChunk *sbus_request_keys = NULL;
static GMemChunk *sbus_request_vals = NULL;
-static guint crc_calc (guint crc, guint val)
+static guint crc_calc (guint crc, guint val)
{
int index;
guint ncrc;
-
+
index = (((crc >> 8) ^ val) & 0xff);
ncrc = crc_table[index] ^ ((crc << 8) & 0xffff);
@@ -496,7 +496,7 @@ static void sbus_init_protocol(void){
}
if (sbus_request_keys){
g_mem_chunk_destroy(sbus_request_keys);
- }
+ }
if (sbus_request_vals){
g_mem_chunk_destroy(sbus_request_vals);
}
@@ -539,7 +539,7 @@ is_sbus_pdu(tvbuff_t *tvb)
/* We should also test version and protocol but that requires
someone to look at the specification for SBUS
*/
-
+
return TRUE;
}
@@ -551,7 +551,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti, *et, *dt, *hi;
proto_tree *sbus_tree, *ethsbus_tree, *sbusdata_tree;
-
+
gint i; /*for CRC calculation*/
gint j; /*for CRC calculation*/
gint offset;
@@ -580,53 +580,53 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sbus_request_key request_key, *new_request_key;
sbus_request_val *request_val = NULL;
- /* does this look like an sbus pdu? */
+ /* does this look like an sbus pdu? */
if(!is_sbus_pdu(tvb)){
return 0;
}
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
-
+
if (!conversation) {
/* create new conversation*/
conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
}
-
+
request_key.conversation = conversation->index;
request_key.sequence = tvb_get_ntohs(tvb,6);
-
- request_val = (sbus_request_val *) g_hash_table_lookup(sbus_request_hash,
+
+ request_val = (sbus_request_val *) g_hash_table_lookup(sbus_request_hash,
&request_key);
/* Only allocate a new hash element when it's a request*/
- sbus_attribut = tvb_get_guint8(tvb,8);
-
+ sbus_attribut = tvb_get_guint8(tvb,8);
+
if ( !request_val && sbus_attribut == 0 ) {/* request telegram */
new_request_key = g_mem_chunk_alloc(sbus_request_keys);
*new_request_key = request_key;
-
+
request_val = g_mem_chunk_alloc(sbus_request_vals);
request_val->cmd_code=tvb_get_guint8(tvb,10);
-
- if (((request_val->cmd_code) == SBUS_RD_USER_EEPROM_REGISTER) ||
+
+ if (((request_val->cmd_code) == SBUS_RD_USER_EEPROM_REGISTER) ||
((request_val->cmd_code) == SBUS_WR_USER_EEPROM_REGISTER)) {
request_val->count=((tvb_get_guint8(tvb,12))+1);
} else {
request_val->count=((tvb_get_guint8(tvb,11))+1);
}
-
+
/*Enter system info*/
if ((request_val->cmd_code) == SBUS_RD_SYSTEM_INFORMATION) {
request_val->sysinfo=(tvb_get_guint8(tvb,12));
} else {
request_val->sysinfo=0x0;
}
-
- g_hash_table_insert(sbus_request_hash, new_request_key, request_val);
+
+ g_hash_table_insert(sbus_request_hash, new_request_key, request_val);
}
/* End of attaching data to hash table*/
-
+
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "S-Bus");
@@ -635,19 +635,19 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO)) {
switch (sbus_attribut){
- case SBUS_REQUEST:
+ case SBUS_REQUEST:
sbus_cmd_code = tvb_get_guint8(tvb,10);
-
- /* Special treatment of web server request
+
+ /* Special treatment of web server request
* as is is very helpful to see more information in the packetlist */
if (sbus_cmd_code == SBUS_WEB_SERVER_SERIAL_COMM) {
sbus_web_aid = tvb_get_guint8(tvb,12);
sbus_web_seq = tvb_get_guint8(tvb,13);
-
+
col_add_fstr(pinfo->cinfo, COL_INFO,
- "Web Server Request: %s (Seq No: %d)",
+ "Web Server Request: %s (Seq No: %d)",
val_to_str(sbus_web_aid,
- webserver_aid_vals, "Unknown Request!"),
+ webserver_aid_vals, "Unknown Request!"),
sbus_web_seq);
} else {
/* All other requests */
@@ -656,15 +656,15 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sbus_command_vals, "Unknown Command!"));
}
break;
-
- case SBUS_RESPONSE:
- /* Special treatment of web server request
+
+ case SBUS_RESPONSE:
+ /* Special treatment of web server request
* as is is very helpful to see more information in the packetlist */
- if (request_val && ((request_val->cmd_code) == SBUS_WEB_SERVER_SERIAL_COMM)) {
+ if (request_val && ((request_val->cmd_code) == SBUS_WEB_SERVER_SERIAL_COMM)) {
sbus_web_size = tvb_get_guint8(tvb,9);
sbus_web_aid = tvb_get_guint8(tvb,10);
col_add_fstr(pinfo->cinfo, COL_INFO,
- "Response: %s",
+ "Response: %s",
val_to_str(sbus_web_aid,
webserver_aid_vals, "Unknown Request!"));
if (sbus_web_size > 1) {
@@ -677,27 +677,27 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Response");
}
break;
-
- case SBUS_ACKNAK:
+
+ case SBUS_ACKNAK:
sbus_ack_code = tvb_get_ntohs(tvb,9);
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s", val_to_str(sbus_ack_code,
- sbus_ack_nak_vals,
+ sbus_ack_nak_vals,
"Unknown NAK response code!"));
break;
-
- default:
+
+ default:
col_set_str(pinfo->cinfo, COL_INFO, "Unknown attribute");
break;
}
- }
+ }
/* create display subtree for the protocol */
- if (tree) {
+ if (tree) {
ti = proto_tree_add_item(tree, proto_sbus, tvb, offset, -1, FALSE);
sbus_tree = proto_item_add_subtree(ti, ett_sbus);
-
+
/*Add subtree for Ether-S-Bus header*/
et = proto_tree_add_text(sbus_tree, tvb, offset, 8, "Ether-S-Bus header");
ethsbus_tree = proto_item_add_subtree(et, ett_sbus_ether);
@@ -705,61 +705,61 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* add an item to the subtree*/
sbus_eth_len = tvb_get_ntohl(tvb,offset);
proto_tree_add_item(ethsbus_tree,
- hf_sbus_length, tvb, offset, 4, FALSE);
+ hf_sbus_length, tvb, offset, 4, FALSE);
offset += 4;
sbus_version = tvb_get_guint8(tvb,offset);
proto_tree_add_item(ethsbus_tree,
- hf_sbus_version, tvb, offset, 1, FALSE);
+ hf_sbus_version, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(ethsbus_tree,
- hf_sbus_protocol, tvb, offset, 1, FALSE);
+ hf_sbus_protocol, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(ethsbus_tree,
- hf_sbus_sequence, tvb, offset, 2, FALSE);
+ hf_sbus_sequence, tvb, offset, 2, FALSE);
offset += 2;
/* Continue adding stuff to the main tree*/
sbus_attribut = tvb_get_guint8(tvb,offset);
proto_tree_add_item(sbus_tree,
- hf_sbus_attribut, tvb, offset, 1, FALSE);
+ hf_sbus_attribut, tvb, offset, 1, FALSE);
offset += 1;
if (sbus_attribut == SBUS_REQUEST) {
proto_tree_add_item(sbus_tree,
- hf_sbus_dest, tvb, offset, 1, FALSE);
+ hf_sbus_dest, tvb, offset, 1, FALSE);
offset += 1;
sbus_cmd_code = tvb_get_guint8(tvb,offset);
proto_tree_add_item(sbus_tree,
- hf_sbus_command, tvb, offset, 1, FALSE);
+ hf_sbus_command, tvb, offset, 1, FALSE);
offset += 1;
-
+
switch (sbus_cmd_code) {
/*Read Counter, Register or Timer*/
case SBUS_RD_COUNTER:
- case SBUS_RD_REGISTER:
+ case SBUS_RD_REGISTER:
case SBUS_RD_TIMER:
sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1;
proto_tree_add_uint(sbus_tree,
- hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
+ hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_rtc, tvb, offset, 2, FALSE);
+ hf_sbus_addr_rtc, tvb, offset, 2, FALSE);
offset += 2;
break;
/*Read Flag, Input or Output*/
case SBUS_RD_FLAG:
- case SBUS_RD_INPUT:
+ case SBUS_RD_INPUT:
case SBUS_RD_OUTPUT:
sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1;
proto_tree_add_uint(sbus_tree,
- hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
+ hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_iof, tvb, offset, 2, FALSE);
+ hf_sbus_addr_iof, tvb, offset, 2, FALSE);
offset += 2;
break;
@@ -776,16 +776,16 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_sbus_wcount, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_rtc, tvb, offset, 2, FALSE);
+ hf_sbus_addr_rtc, tvb, offset, 2, FALSE);
offset += 2;
/*Add subtree for Data*/
dt = proto_tree_add_text(sbus_tree, tvb, offset,
((sbus_media_cnt) * 4),"Data");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=((sbus_media_cnt)); i>0; i--) {
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_rtc, tvb, offset,
+ hf_sbus_data_rtc, tvb, offset,
4, FALSE);
offset += 4;
}
@@ -803,34 +803,34 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_sbus_wcount, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_iof, tvb, offset, 2, FALSE);
+ hf_sbus_addr_iof, tvb, offset, 2, FALSE);
offset += 2;
sbus_fio_cnt = (tvb_get_guint8(tvb,offset));
sbus_fio_cnt = ((sbus_fio_cnt + 1));
proto_tree_add_uint(sbus_tree,
- hf_sbus_fio_count, tvb, offset, 1, sbus_fio_cnt);
- offset += 1;
+ hf_sbus_fio_count, tvb, offset, 1, sbus_fio_cnt);
+ offset += 1;
/*Add subtree for Data*/
dt = proto_tree_add_text(sbus_tree, tvb, offset,
sbus_media_cnt,"Data");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=sbus_media_cnt; i>0; i--) {
sbus_helper = 1;
sbus_show_bin = 0;
- sbus_binarymasked = 0x01;
+ sbus_binarymasked = 0x01;
sbus_binaries = tvb_get_guint8(tvb, offset);
for (j=0; j<8; j++) {
if ((sbus_binarymasked & sbus_binaries) != 0) {
sbus_show_bin = (sbus_show_bin + sbus_helper);
}
sbus_binarymasked = sbus_binarymasked<<1;
- sbus_helper = 10 * sbus_helper;
+ sbus_helper = 10 * sbus_helper;
}
-
+
proto_tree_add_uint_format(sbusdata_tree,
hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin,
- "Binary data: %08u", sbus_show_bin);
+ "Binary data: %08u", sbus_show_bin);
offset += 1;
}
break;
@@ -840,45 +840,45 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sbus_helper = tvb_get_guint8(tvb, (offset +5)); /*hours*/
sbus_helper1 = tvb_get_guint8(tvb, (offset +6)); /*minutes*/
sbus_helper2 = tvb_get_guint8(tvb, (offset +7)); /*seconds*/
- proto_tree_add_text(sbus_tree, tvb, (offset +5), 3,
+ proto_tree_add_text(sbus_tree, tvb, (offset +5), 3,
"Time (HH:MM:SS): %02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2);
sbus_helper = tvb_get_guint8(tvb, (offset +2)); /*year*/
sbus_helper1 = tvb_get_guint8(tvb, (offset +3)); /*month*/
sbus_helper2 = tvb_get_guint8(tvb, (offset +4)); /*day*/
- proto_tree_add_text(sbus_tree, tvb, (offset +2), 3,
+ proto_tree_add_text(sbus_tree, tvb, (offset +2), 3,
"Date (YY/MM/DD): %02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2);
sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/
sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/
- proto_tree_add_text(sbus_tree, tvb, offset, 2,
+ proto_tree_add_text(sbus_tree, tvb, offset, 2,
"Calendar week: %x, Week day: %x", sbus_helper, sbus_helper1);
/*Add subtree for Data*/
- dt = proto_tree_add_text(sbus_tree, tvb, offset,
+ dt = proto_tree_add_text(sbus_tree, tvb, offset,
8, "Clock data");
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
-
+
proto_tree_add_item(sbusdata_tree,
- hf_sbus_week_day, tvb, offset, 2, FALSE);
+ hf_sbus_week_day, tvb, offset, 2, FALSE);
offset += 2;
proto_tree_add_item(sbusdata_tree,
- hf_sbus_date, tvb, offset, 3, FALSE);
+ hf_sbus_date, tvb, offset, 3, FALSE);
offset += 3;
proto_tree_add_item(sbusdata_tree,
- hf_sbus_time, tvb, offset, 3, FALSE);
+ hf_sbus_time, tvb, offset, 3, FALSE);
offset += 3;
break;
-
+
/* Read user memory or program line*/
case SBUS_RD_USER_MEMORY:
case SBUS_RD_PROGRAM_LINE:
sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1;
proto_tree_add_uint(sbus_tree,
- hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
+ hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_prog, tvb, offset, 3, FALSE);
+ hf_sbus_addr_prog, tvb, offset, 3, FALSE);
offset += 3;
break;
-
+
/*Write user memory*/
case SBUS_WR_USER_MEMORY:
sbus_media_cnt = (tvb_get_guint8(tvb,offset));
@@ -890,33 +890,33 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_sbus_wcount, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_68k, tvb, offset, 3, FALSE);
+ hf_sbus_addr_68k, tvb, offset, 3, FALSE);
offset += 3;
/*Add subtree for Data*/
dt = proto_tree_add_text(sbus_tree, tvb, offset,
((sbus_media_cnt) * 4),"Program lines");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=((sbus_media_cnt)); i>0; i--) {
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_rtc, tvb, offset,
- 4, FALSE);
- offset += 4;
-
+ hf_sbus_data_rtc, tvb, offset,
+ 4, FALSE);
+ offset += 4;
+
}
break;
-
+
/* Read byte*/
case SBUS_RD_BYTE:
sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1;
proto_tree_add_uint(sbus_tree,
- hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
+ hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_68k, tvb, offset, 3, FALSE);
+ hf_sbus_addr_68k, tvb, offset, 3, FALSE);
offset += 3;
break;
-
+
/* Write byte */
case SBUS_WR_BYTE:
sbus_media_cnt = (tvb_get_guint8(tvb,offset));
@@ -928,48 +928,48 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_sbus_wcount, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_68k, tvb, offset, 3, FALSE);
+ hf_sbus_addr_68k, tvb, offset, 3, FALSE);
offset += 3;
/*Add subtree for Data*/
dt = proto_tree_add_text(sbus_tree, tvb, offset,
((sbus_media_cnt) * 4),"Data (bytes)");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=sbus_media_cnt; i>0; i--) {
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_byte, tvb, offset,
- 1, FALSE);
- offset += 1;
+ hf_sbus_data_byte, tvb, offset,
+ 1, FALSE);
+ offset += 1;
}
break;
-
+
/*Read EEPROM register*/
case SBUS_RD_USER_EEPROM_REGISTER:
proto_tree_add_item(sbus_tree,
- hf_sbus_command_extension, tvb, offset, 1, FALSE);
+ hf_sbus_command_extension, tvb, offset, 1, FALSE);
offset += 1;
sbus_media_cnt = (tvb_get_guint8(tvb,offset))+1;
proto_tree_add_uint(sbus_tree,
- hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
+ hf_sbus_rcount, tvb, offset, 1, sbus_media_cnt);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_eeprom, tvb, offset, 2, FALSE);
+ hf_sbus_addr_eeprom, tvb, offset, 2, FALSE);
offset += 2;
break;
-
+
/*Request for reading system info*/
/*Syinfo 05 is not implemented as no serial baud is possible*/
case SBUS_RD_SYSTEM_INFORMATION:
sbus_sysinfo_number = (tvb_get_guint8(tvb,13));
proto_tree_add_item(sbus_tree,
- hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE);
+ hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE);
offset += 1;
sbus_sysinfo_number = (tvb_get_guint8(tvb,14));
proto_tree_add_item(sbus_tree,
- hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE);
+ hf_sbus_sysinfo_nr, tvb, offset, 1, FALSE);
offset += 1;
break;
-
+
/* WebServer Request */
case SBUS_WEB_SERVER_SERIAL_COMM:
sbus_web_size = tvb_get_guint8(tvb,offset);
@@ -989,18 +989,18 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_sbus_web_seq, tvb, offset,
1, sbus_web_seq);
offset += 1;
-
+
if (sbus_web_size > 1) {
dt = proto_tree_add_text(sbus_tree, tvb, offset,
(sbus_web_size - 1),"Data (bytes)");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=sbus_web_size -1 ; i>0; i--) {
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_byte, tvb, offset,
- 1, FALSE);
+ hf_sbus_data_byte, tvb, offset,
+ 1, FALSE);
offset += 1;
- }
+ }
}
break;
@@ -1008,9 +1008,9 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (sbus_eth_len > 13) { /*13 bytes is the minimal length of a request telegram...*/
sbus_helper = sbus_eth_len - (offset + 2);
- proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper,
+ proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper,
"This telegram isn't implemented in the dissector.");
- offset = offset + sbus_helper;
+ offset = offset + sbus_helper;
}
}
}
@@ -1031,8 +1031,8 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=(request_val->count); i>0; i--) {
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_rtc, tvb, offset,
- 4, FALSE);
+ hf_sbus_data_rtc, tvb, offset,
+ 4, FALSE);
offset += 4;
}
break;
@@ -1040,7 +1040,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Response: PCD Display register*/
case SBUS_RD_DISPLAY_REGISTER:
proto_tree_add_item(sbus_tree,
- hf_sbus_display_register, tvb, offset, 4, FALSE);
+ hf_sbus_display_register, tvb, offset, 4, FALSE);
offset += 4;
break;
@@ -1049,62 +1049,62 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SBUS_RD_INPUT:
case SBUS_RD_OUTPUT:
/*Add subtree for Data*/
- dt = proto_tree_add_text(sbus_tree, tvb, offset,
+ dt = proto_tree_add_text(sbus_tree, tvb, offset,
(((request_val->count) + 7) / 8), "Data");
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
-
+
for (i=(((request_val->count) + 7) / 8); i>0; i--) {
sbus_helper = 1;
sbus_show_bin = 0;
- sbus_binarymasked = 0x01;
+ sbus_binarymasked = 0x01;
sbus_binaries = tvb_get_guint8(tvb, offset);
for (j=0; j<8; j++){
if ((sbus_binarymasked & sbus_binaries) != 0) {
sbus_show_bin = (sbus_show_bin + sbus_helper);
}
sbus_binarymasked = sbus_binarymasked<<1;
- sbus_helper = 10 * sbus_helper;
+ sbus_helper = 10 * sbus_helper;
}
-
+
proto_tree_add_uint_format(sbusdata_tree,
hf_sbus_data_iof, tvb, offset, 1, sbus_show_bin,
- "Binary data: %08u", sbus_show_bin);
+ "Binary data: %08u", sbus_show_bin);
offset += 1;
}
break;
-
+
/* Response: Real time clock value*/
- case SBUS_RD_RTC:
+ case SBUS_RD_RTC:
sbus_helper = tvb_get_guint8(tvb, (offset +5)); /*hours*/
sbus_helper1 = tvb_get_guint8(tvb, (offset +6)); /*minutes*/
sbus_helper2 = tvb_get_guint8(tvb, (offset +7)); /*seconds*/
- proto_tree_add_text(sbus_tree, tvb, (offset +5), 3,
+ proto_tree_add_text(sbus_tree, tvb, (offset +5), 3,
"Time (HH:MM:SS): %02x:%02x:%02x", sbus_helper, sbus_helper1, sbus_helper2);
sbus_helper = tvb_get_guint8(tvb, (offset +2)); /*year*/
sbus_helper1 = tvb_get_guint8(tvb, (offset +3)); /*month*/
sbus_helper2 = tvb_get_guint8(tvb, (offset +4)); /*day*/
- proto_tree_add_text(sbus_tree, tvb, (offset +2), 3,
+ proto_tree_add_text(sbus_tree, tvb, (offset +2), 3,
"Date (YY/MM/DD): %02x/%02x/%02x", sbus_helper, sbus_helper1, sbus_helper2);
sbus_helper = tvb_get_guint8(tvb, (offset)); /*year-week*/
sbus_helper1 = tvb_get_guint8(tvb, (offset +1)); /*week-day*/
- proto_tree_add_text(sbus_tree, tvb, offset, 2,
+ proto_tree_add_text(sbus_tree, tvb, offset, 2,
"Calendar week: %x, Week day: %x", sbus_helper, sbus_helper1);
/*Add subtree for Data*/
- dt = proto_tree_add_text(sbus_tree, tvb, offset,
+ dt = proto_tree_add_text(sbus_tree, tvb, offset,
8, "Clock data");
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
-
+
proto_tree_add_item(sbusdata_tree,
- hf_sbus_week_day, tvb, offset, 2, FALSE);
+ hf_sbus_week_day, tvb, offset, 2, FALSE);
offset += 2;
proto_tree_add_item(sbusdata_tree,
- hf_sbus_date, tvb, offset, 3, FALSE);
+ hf_sbus_date, tvb, offset, 3, FALSE);
offset += 3;
proto_tree_add_item(sbusdata_tree,
- hf_sbus_time, tvb, offset, 3, FALSE);
+ hf_sbus_time, tvb, offset, 3, FALSE);
offset += 3;
break;
-
+
/* Response: CPU status, the command codes 14..1B are concerned*/
case SBUS_RD_PCD_STATUS_CPU0:
case SBUS_RD_PCD_STATUS_CPU1:
@@ -1115,40 +1115,38 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SBUS_RD_PCD_STATUS_CPU6:
case SBUS_RD_PCD_STATUS_OWN:
proto_tree_add_item(sbus_tree,
- hf_sbus_cpu_status, tvb, offset, 1, FALSE);
+ hf_sbus_cpu_status, tvb, offset, 1, FALSE);
offset += 1;
break;
-
+
/* Response: Station address*/
case SBUS_RD_SBUS_STN_NBR:
proto_tree_add_item(sbus_tree,
- hf_sbus_address, tvb, offset, 1, FALSE);
+ hf_sbus_address, tvb, offset, 1, FALSE);
offset += 1;
break;
-
+
/* Response: Firmware version */
case SBUS_RD_PROGRAM_VERSION:
/*PCD type*/
- tmp_string = tvb_get_string(tvb, offset, 5);
+ tmp_string = tvb_get_ephemeral_string(tvb , offset, 5);
proto_tree_add_string(sbus_tree,
hf_sbus_cpu_type, tvb, offset, 5, tmp_string);
- offset += 5;
- g_free(tmp_string);
+ offset += 5;
/*FW version*/
- tmp_string = tvb_get_string(tvb , offset, 3);
+ tmp_string = tvb_get_ephemeral_string(tvb , offset, 3);
proto_tree_add_string(sbus_tree,
hf_sbus_fw_version, tvb, offset, 3, tmp_string);
offset += 4;
- g_free(tmp_string);
break;
-
+
/* Response for Status Flags*/
case SBUS_RD_STATUSFLAG_ACCU:
/*Add subtree for Data*/
dt = proto_tree_add_text(sbus_tree, tvb, offset,
1,"ACCU and arithmetic status");
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
-
+
proto_tree_add_item(sbusdata_tree, hf_sbus_flags_accu,
tvb, offset, 1, FALSE);
proto_tree_add_item(sbusdata_tree, hf_sbus_flags_error,
@@ -1159,61 +1157,61 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, offset, 1, FALSE);
offset +=1;
break;
-
+
/* Response for Read byte */
case SBUS_RD_BYTE:
/*Add subtree for Data*/
dt = proto_tree_add_text(sbus_tree, tvb, offset,
(request_val->count),"Data (bytes)");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=(request_val->count); i>0; i--) {
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_byte, tvb, offset,
- 1, FALSE);
+ hf_sbus_data_byte, tvb, offset,
+ 1, FALSE);
offset += 1;
}
break;
-
+
/* Response for Read Index register */
case SBUS_RD_INDEX_REGISTER:
/*Add subtree for Data*/
dt = proto_tree_add_text(sbus_tree, tvb, offset,
2,"Data (hex bytes)");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=0; i<2; i++) { /*2 bytes*/
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_byte_hex, tvb, offset,
- 1, FALSE);
+ hf_sbus_data_byte_hex, tvb, offset,
+ 1, FALSE);
offset += 1;
}
break;
-
+
/* Response: Instruction pointer*/
case SBUS_RD_INSTRUCTION_POINTER:
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_prog, tvb, offset, 3, FALSE);
+ hf_sbus_addr_prog, tvb, offset, 3, FALSE);
offset += 3;
break;
-
+
/*Response for Find History*/
case SBUS_FIND_HISTORY:
proto_tree_add_item(sbus_tree,
- hf_sbus_addr_68k, tvb, offset, 3, FALSE);
+ hf_sbus_addr_68k, tvb, offset, 3, FALSE);
offset += 3;
proto_tree_add_item(sbus_tree,
- hf_sbus_nbr_elements, tvb, offset, 2, FALSE);
+ hf_sbus_nbr_elements, tvb, offset, 2, FALSE);
offset += 2;
break;
-
+
/* Response: Read current block*/
case SBUS_RD_CURRENT_BLOCK:
proto_tree_add_item(sbus_tree,
- hf_sbus_block_type, tvb, offset, 1, FALSE);
+ hf_sbus_block_type, tvb, offset, 1, FALSE);
offset += 1;
proto_tree_add_item(sbus_tree,
- hf_sbus_block_nr, tvb, offset, 2, FALSE);
+ hf_sbus_block_nr, tvb, offset, 2, FALSE);
offset += 2;
break;
@@ -1225,7 +1223,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dt = proto_tree_add_text(sbus_tree, tvb, offset,
1,"System info");
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
-
+
proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_1,
tvb, offset, 1, FALSE);
proto_tree_add_item(sbusdata_tree, hf_sbus_sysinfo0_2,
@@ -1239,7 +1237,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
}
break;
-
+
/* Response: Webserver request */
case SBUS_WEB_SERVER_SERIAL_COMM:
sbus_web_size = tvb_get_guint8(tvb,offset);
@@ -1247,7 +1245,7 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_sbus_web_size, tvb, offset,
1, sbus_web_size);
offset += 1;
-
+
sbus_web_aid = tvb_get_guint8(tvb,offset);
proto_tree_add_item(sbus_tree,
hf_sbus_web_aid, tvb, offset,
@@ -1260,36 +1258,36 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_sbus_web_seq, tvb, offset,
1, sbus_web_seq);
offset += 1;
-
+
dt = proto_tree_add_text(sbus_tree, tvb, offset,
(sbus_web_size - 2),"Data (bytes)");
-
+
sbusdata_tree = proto_item_add_subtree(dt, ett_sbus_data);
for (i=sbus_web_size - 2; i>0; i--) {
proto_tree_add_item(sbusdata_tree,
- hf_sbus_data_byte, tvb, offset,
- 1, FALSE);
- offset += 1;
+ hf_sbus_data_byte, tvb, offset,
+ 1, FALSE);
+ offset += 1;
}
}
break;
-
+
/*Inform that response was not dissected and add remaining length*/
default:
sbus_helper = sbus_eth_len - (offset + 2);
- proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper,
+ proto_tree_add_text(sbus_tree, tvb, offset, sbus_helper,
"This telegram isn't implemented in the dissector.");
offset = offset + sbus_helper;
break;
}
}
-
+
if (sbus_attribut == SBUS_ACKNAK) {
proto_tree_add_item(sbus_tree,
- hf_sbus_acknackcode, tvb, offset, 2, FALSE);
+ hf_sbus_acknackcode, tvb, offset, 2, FALSE);
offset += 2;
}
-
+
/* Calclulate CRC */
sbus_crc_calc = 0;
for (i = 0; i < sbus_eth_len - 2; i++)
@@ -1298,13 +1296,13 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sbus_helper = tvb_get_ntohs(tvb, offset);
if (sbus_helper == sbus_crc_calc) {
proto_tree_add_uint_format(sbus_tree,
- hf_sbus_crc, tvb, offset, 2, sbus_helper,
+ hf_sbus_crc, tvb, offset, 2, sbus_helper,
"Checksum: 0x%04x (correct)", sbus_helper);
} else {
proto_tree_add_uint_format(sbus_tree,
- hf_sbus_crc, tvb, offset, 2, sbus_helper,
+ hf_sbus_crc, tvb, offset, 2, sbus_helper,
"Checksum: 0x%04x (NOT correct)", sbus_helper);
- hi = proto_tree_add_boolean(sbus_tree,
+ hi = proto_tree_add_boolean(sbus_tree,
hf_sbus_crc_bad, tvb, offset + 2, 2, TRUE);
PROTO_ITEM_SET_HIDDEN(hi);
}
@@ -1321,310 +1319,310 @@ proto_register_sbus(void)
{
/* Setup list of header fields See Section 1.6.1 for details*/
- static hf_register_info hf[] = {
+ static hf_register_info hf[] = {
{ &hf_sbus_length,
{ "Length (bytes)", "sbus.len",
- FT_UINT32, BASE_DEC, NULL, 0,
+ FT_UINT32, BASE_DEC, NULL, 0,
"SAIA Ether-S-Bus telegram length", HFILL }
},
{ &hf_sbus_version,
{ "Version", "sbus.vers",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"SAIA Ether-S-Bus version", HFILL }
},
{ &hf_sbus_protocol,
{ "Protocol type", "sbus.proto",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"SAIA Ether-S-Bus protocol type", HFILL }
},
{ &hf_sbus_sequence,
{ "Sequence", "sbus.seq",
- FT_UINT16, BASE_DEC, NULL, 0,
+ FT_UINT16, BASE_DEC, NULL, 0,
"SAIA Ether-S-Bus sequence number", HFILL }
},
{ &hf_sbus_attribut,
{ "Telegram attribute", "sbus.att",
- FT_UINT8, BASE_HEX, VALS(sbus_att_vals), 0,
+ FT_UINT8, BASE_HEX, VALS(sbus_att_vals), 0,
"SAIA Ether-S-Bus telegram attribute, indicating type of telegram", HFILL }
},
{ &hf_sbus_dest,
{ "Destination", "sbus.destination",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"SAIA S-Bus destination address", HFILL }
},
-
+
{ &hf_sbus_address,
{ "S-Bus address", "sbus.address",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"SAIA S-Bus station address", HFILL }
},
-
+
{ &hf_sbus_command,
{ "Command", "sbus.cmd",
- FT_UINT8, BASE_HEX, VALS(sbus_command_vals), 0,
+ FT_UINT8, BASE_HEX, VALS(sbus_command_vals), 0,
"SAIA S-Bus command", HFILL }
},
{ &hf_sbus_command_extension,
{ "Command extension", "sbus.cmd_extn",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_UINT8, BASE_HEX, NULL, 0,
"SAIA S-Bus command extension", HFILL }
},
-
+
{ &hf_sbus_rcount,
{ "R-count", "sbus.rcount",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"Number of elements expected in response", HFILL }
},
-
+
{ &hf_sbus_wcount,
{ "W-count (raw)", "sbus.wcount",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"Number of bytes to be written", HFILL }
},
{ &hf_sbus_wcount_calculated,
{ "W-count (32 bit values)", "sbus.wcount_calc",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"Number of elements to be written", HFILL }
},
{ &hf_sbus_fio_count,
{ "FIO Count (amount of bits)", "sbus.fio_count",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"Number of binary elements to be written", HFILL }
},
-
+
{ &hf_sbus_addr_rtc,
{ "Base address RTC", "sbus.addr_RTC",
- FT_UINT16, BASE_DEC, NULL, 0,
+ FT_UINT16, BASE_DEC, NULL, 0,
"Base address of 32 bit elements to read", HFILL }
},
-
+
{ &hf_sbus_addr_iof,
{ "Base address IOF", "sbus.addr_IOF",
- FT_UINT16, BASE_DEC, NULL, 0,
+ FT_UINT16, BASE_DEC, NULL, 0,
"Base address of binary elements to read", HFILL }
},
-
+
{ &hf_sbus_addr_eeprom,
{ "Base address of EEPROM register", "sbus.addr_EEPROM",
- FT_UINT16, BASE_DEC, NULL, 0,
+ FT_UINT16, BASE_DEC, NULL, 0,
"Base address of 32 bit EEPROM register to read or write", HFILL }
},
-
+
{ &hf_sbus_addr_prog,
{ "Base address of user memory or program lines", "sbus.addr_prog",
- FT_UINT24, BASE_DEC, NULL, 0,
+ FT_UINT24, BASE_DEC, NULL, 0,
"Base address of the user memory or program lines (read or write)", HFILL }
},
-
+
{ &hf_sbus_addr_68k,
{ "Base address of bytes", "sbus.addr_prog",
- FT_UINT24, BASE_HEX, NULL, 0,
+ FT_UINT24, BASE_HEX, NULL, 0,
"Base address of bytes to read or write (68k address)", HFILL }
},
-
+
{ &hf_sbus_block_type,
{ "Block type", "sbus.block_type",
- FT_UINT8, BASE_HEX, VALS(sbus_block_types), 0,
+ FT_UINT8, BASE_HEX, VALS(sbus_block_types), 0,
"Program block type read", HFILL }
},
-
+
{ &hf_sbus_block_nr,
{ "Block/Element nr", "sbus.block_nr",
- FT_UINT16, BASE_DEC, NULL, 0,
+ FT_UINT16, BASE_DEC, NULL, 0,
"Program block / DatatBlock number", HFILL }
},
-
+
{ &hf_sbus_nbr_elements,
{ "Number of elements", "sbus.nbr_elements",
- FT_UINT16, BASE_DEC, NULL, 0,
+ FT_UINT16, BASE_DEC, NULL, 0,
"Number of elements or characters", HFILL }
},
-
+
{ &hf_sbus_display_register,
{ "PCD Display register", "sbus.data_display_register",
- FT_UINT32, BASE_DEC, NULL, 0,
+ FT_UINT32, BASE_DEC, NULL, 0,
"The PCD display register (32 bit value)", HFILL }
},
-
+
{ &hf_sbus_data_rtc,
{ "S-Bus 32-bit data", "sbus.data_rtc",
- FT_UINT32, BASE_DEC, NULL, 0,
+ FT_UINT32, BASE_DEC, NULL, 0,
"One regiser/timer of counter (32 bit value)", HFILL }
},
-
+
{ &hf_sbus_data_byte,
{ "Data bytes", "sbus.data_byte",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"One byte from PCD", HFILL }
},
-
+
{ &hf_sbus_data_byte_hex,
{ "Data bytes (hex)", "sbus.data_byte_hex",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_UINT8, BASE_HEX, NULL, 0,
"One byte from PCD (hexadecimal)", HFILL }
},
-
+
{ &hf_sbus_data_iof,
{ "S-Bus binary data", "sbus.data_iof",
- FT_UINT32, BASE_DEC, NULL, 0,
+ FT_UINT32, BASE_DEC, NULL, 0,
"8 binaries", HFILL }
},
-
+
{ &hf_sbus_cpu_type,
{ "PCD type", "sbus.pcd_type",
FT_STRING, BASE_NONE, NULL, 0,
"PCD type (short form)", HFILL }
},
-
+
{ &hf_sbus_fw_version,
{ "Firmware version", "sbus.fw_version",
FT_STRING, BASE_NONE, NULL, 0,
"Firmware version of the PCD or module", HFILL }
},
-
+
{ &hf_sbus_sysinfo_nr,
{ "System information number", "sbus.sysinfo",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_UINT8, BASE_HEX, NULL, 0,
"System information number (extension to command code)", HFILL }
},
-
+
{ &hf_sbus_sysinfo0_1,
{ "Mem size info", "sbus.sysinfo0.mem",
- FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_MEMSIZE,
+ FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_MEMSIZE,
"Availability of memory size information", HFILL }
},
{ &hf_sbus_sysinfo0_2,
{ "Trace buffer", "sbus.sysinfo0.trace",
- FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_TRACE,
+ FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_TRACE,
"Availability of trace buffer feature", HFILL }
},
{ &hf_sbus_sysinfo0_3,
{ "Slot B1", "sbus.sysinfo0.b1",
- FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_INFO_B1,
+ FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_INFO_B1,
"Presence of EEPROM information on slot B1", HFILL }
},
{ &hf_sbus_sysinfo0_4,
{ "Slot B2", "sbus.sysinfo0.b2",
- FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_INFO_B2,
+ FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_INFO_B2,
"Presence of EEPROM information on slot B2", HFILL }
},
{ &hf_sbus_sysinfo0_5,
{ "PGU baud", "sbus.sysinfo0.pgubaud",
- FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_PGU_BAUD,
+ FT_BOOLEAN, 8, TFS(&tfs_sbus_present), F_PGU_BAUD,
"Availability of PGU baud switch feature", HFILL }
},
-
+
{ &hf_sbus_sysinfo_length,
{ "System information length", "sbus.sysinfo_length",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_UINT8, BASE_HEX, NULL, 0,
"System information length in response", HFILL }
},
-
+
{ &hf_sbus_f_module_type,
{ "F-module type", "sbus.fmodule_type",
FT_STRING, BASE_NONE, NULL, 0,
"Module type mounted on B1/2 slot", HFILL }
},
-
+
{ &hf_sbus_harware_version,
{ "Hardware version", "sbus.hw_version",
FT_STRING, BASE_NONE, NULL, 0,
"Hardware version of the PCD or the module", HFILL }
},
-
+
{ &hf_sbus_hardware_modification,
{ "Hardware modification", "sbus.hw_modification",
- FT_UINT8, BASE_DEC, NULL, 0,
+ FT_UINT8, BASE_DEC, NULL, 0,
"Hardware modification of the PCD or module", HFILL }
},
-
+
{ &hf_sbus_various,
{ "Various data", "sbus.various",
- FT_NONE, BASE_NONE, NULL, 0,
+ FT_NONE, BASE_NONE, NULL, 0,
"Various data contained in telegrams but nobody will search for it", HFILL }
},
-
+
{ &hf_sbus_acknackcode,
{ "ACK/NAK code", "sbus.nakcode",
- FT_UINT16, BASE_HEX, VALS(sbus_ack_nak_vals), 0,
+ FT_UINT16, BASE_HEX, VALS(sbus_ack_nak_vals), 0,
"SAIA S-Bus ACK/NAK response", HFILL }
},
-
+
{ &hf_sbus_cpu_status,
{ "CPU status", "sbus.CPU_status",
- FT_UINT8, BASE_HEX, VALS(sbus_CPU_status), 0,
+ FT_UINT8, BASE_HEX, VALS(sbus_CPU_status), 0,
"SAIA PCD CPU status", HFILL }
},
-
+
{ &hf_sbus_week_day,
{ "RTC calendar week and week day", "sbus.rtc.week_day",
- FT_UINT16, BASE_HEX, NULL, 0,
+ FT_UINT16, BASE_HEX, NULL, 0,
"Calendar week and week day number of the real time clock", HFILL }
},
{ &hf_sbus_date,
{ "RTC date (YYMMDD)", "sbus.rtc.date",
- FT_UINT24, BASE_HEX, NULL, 0,
+ FT_UINT24, BASE_HEX, NULL, 0,
"Year, month and day of the real time clock", HFILL }
},
-
+
{ &hf_sbus_time,
{ "RTC time (HHMMSS)", "sbus.rtc.time",
- FT_UINT24, BASE_HEX, NULL, 0,
+ FT_UINT24, BASE_HEX, NULL, 0,
"Time of the real time clock", HFILL }
},
-
+
{ &hf_sbus_web_size,
{ "Web server packet size", "sbus.web.size",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_UINT8, BASE_HEX, NULL, 0,
NULL, HFILL }
},
-
+
{ &hf_sbus_web_aid,
{ "AID", "sbus.web.aid",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_UINT8, BASE_HEX, NULL, 0,
"Web server command/status code (AID)", HFILL }
},
-
+
{ &hf_sbus_web_seq,
{ "Sequence", "sbus.web.seq",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_UINT8, BASE_HEX, NULL, 0,
"Web server sequence nr (PACK_N)", HFILL }
},
{ &hf_sbus_crc,
{ "Checksum", "sbus.crc",
- FT_UINT16, BASE_HEX, NULL, 0,
+ FT_UINT16, BASE_HEX, NULL, 0,
"CRC 16", HFILL }
},
{ &hf_sbus_crc_bad,
{ "Bad Checksum", "sbus.crc_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
- "A bad checksum in the telegram", HFILL }},
-
+ "A bad checksum in the telegram", HFILL }},
+
{ &hf_sbus_flags_accu,
{ "ACCU", "sbus.flags.accu",
FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_ACCU,
"PCD Accumulator", HFILL }
},
-
+
{ &hf_sbus_flags_error,
{ "Error flag", "sbus.flags.error",
FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_ERROR,
"PCD error flag", HFILL }
},
-
+
{ &hf_sbus_flags_negative,
{ "N-flag", "sbus.flags.nflag",
FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_NEGATIVE,
"Negative status flag", HFILL }
},
-
+
{ &hf_sbus_flags_zero,
{ "Z-flag", "sbus.flags.zflag",
FT_BOOLEAN, 8, TFS(&tfs_sbus_flags), F_ZERO,
@@ -1647,7 +1645,7 @@ proto_register_sbus(void)
proto_register_subtree_array(ett, array_length(ett));
register_init_routine(&sbus_init_protocol);
}
-
+
void
proto_reg_handoff_sbus(void)
{