MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-ppi-geolocation-common.c
blobcab01a5e5cf6a6350305c0da5634428cd8916620
1 /* packet-ppi-geolocation-common.c
2 * Routines for PPI-GEOLOCATION dissection
3 * Copyright 2010, Harris Corp, jellch@harris.com
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include "config.h"
28 #include <glib.h>
29 #include "packet-ppi-geolocation-common.h"
32 * input: a unsigned 32-bit (native endian) value between 0 and 3600000000 (inclusive)
33 * output: a signed floating point value betwen -180.0000000 and + 180.0000000, inclusive)
35 gdouble ppi_fixed3_7_to_gdouble(guint32 in) {
36 gint32 remapped_in = in - (180 * 10000000);
37 gdouble ret = (gdouble) ((gdouble) remapped_in / 10000000);
38 return ret;
41 * input: a native 32 bit unsigned value between 0 and 999999999
42 * output: a positive floating point value between 000.0000000 and 999.9999999
45 gdouble ppi_fixed3_6_to_gdouble(guint32 in) {
46 gdouble ret = (gdouble) in / 1000000.0;
47 return ret;
51 * input: a native 32 bit unsigned value between 0 and 3600000000
52 * output: a signed floating point value between -180000.0000 and +180000.0000
54 gdouble ppi_fixed6_4_to_gdouble(guint32 in) {
55 gint32 remapped_in = in - (180000 * 10000);
56 gdouble ret = (gdouble) ((gdouble) remapped_in / 10000);
57 return ret;
60 gdouble ppi_ns_counter_to_gdouble(guint32 in) {
61 gdouble ret;
62 ret = (gdouble) in / 1000000000;
63 return ret;
67 * Editor modelines
69 * Local Variables:
70 * c-basic-offset: 4
71 * tab-width: 8
72 * indent-tabs-mode: nil
73 * End:
75 * ex: set shiftwidth=4 tabstop=8 expandtab:
76 * :indentSize=4:tabSize=8:noTabs=true: