aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/lcsap
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-11-06 09:22:29 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-11-06 09:22:29 +0000
commit9bdaeafabfcfff10593239d691fb9f04aa159a61 (patch)
tree77bf33bc0b37f353fed5921765f21bcea56b14dc /asn1/lcsap
parent04054fae804cbe5554bd86509a74f0f725d021b1 (diff)
Dissect lat. long and Uncertainty-Code.
svn path=/trunk/; revision=45946
Diffstat (limited to 'asn1/lcsap')
-rw-r--r--asn1/lcsap/lcsap.cnf26
-rw-r--r--asn1/lcsap/packet-lcsap-template.c2
2 files changed, 28 insertions, 0 deletions
diff --git a/asn1/lcsap/lcsap.cnf b/asn1/lcsap/lcsap.cnf
index 45d6a6f1aa..f943475f54 100644
--- a/asn1/lcsap/lcsap.cnf
+++ b/asn1/lcsap/lcsap.cnf
@@ -199,6 +199,32 @@ ProtocolIE-Field/value ie_field_value
proto_tree_add_item(tree, hf_lcsap_gnss_id, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_lcsap_gnss_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
+#
+# Code copied from packet-gsm_a_common.c
+#.FN_BODY Uncertainty-Code VAL_PTR = &uncertainty_code
+ guint32 uncertainty_code;
+
+ offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
+ 0U, 127U, &uncertainty_code, FALSE);
+
+ proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1));
+
+#.FN_BODY DegreesLatitude VAL_PTR = &degrees
+ guint32 degrees;
+
+ offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
+ 0U, 8388607U, &degrees, FALSE);
+
+ proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/8388607) * 90));
+
+#.FN_BODY DegreesLongitude VAL_PTR = &degrees
+ guint32 degrees;
+
+ offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
+ -8388608, 8388607U, &degrees, FALSE);
+
+ proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/16777215) * 360));
+
#.TYPE_ATTR
ProtocolExtensionID TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(lcsap_ProtocolIE_ID_vals)
#.ASSIGN_VALUE_TO_TYPE # LCSAP does not have constants assigned to types, they are pure INTEGER
diff --git a/asn1/lcsap/packet-lcsap-template.c b/asn1/lcsap/packet-lcsap-template.c
index 5191869119..3a9279f2a4 100644
--- a/asn1/lcsap/packet-lcsap-template.c
+++ b/asn1/lcsap/packet-lcsap-template.c
@@ -34,6 +34,8 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
+#include <math.h>
+
#include <epan/strutil.h>
#include <epan/asn1.h>
#include <epan/prefs.h>