1 /* packet-ppi-geolocation-common.c
2 * Routines for PPI-GEOLOCATION dissection
3 * Copyright 2010, Harris Corp, jellch@harris.com
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include "packet-ppi-geolocation-common.h"
18 * input: a unsigned 32-bit (native endian) value between 0 and 3600000000 (inclusive)
19 * output: a signed floating point value between -180.0000000 and + 180.0000000, inclusive)
21 double ppi_fixed3_7_to_double(uint32_t in
) {
22 int32_t remapped_in
= in
- (180 * 10000000);
23 double ret
= (double) ((double) remapped_in
/ 10000000);
27 * input: a native 32 bit unsigned value between 0 and 999999999
28 * output: a positive floating point value between 000.0000000 and 999.9999999
31 double ppi_fixed3_6_to_double(uint32_t in
) {
32 double ret
= (double) in
/ 1000000.0;
37 * input: a native 32 bit unsigned value between 0 and 3600000000
38 * output: a signed floating point value between -180000.0000 and +180000.0000
40 double ppi_fixed6_4_to_double(uint32_t in
) {
41 int32_t remapped_in
= in
- (180000 * 10000);
42 double ret
= (double) ((double) remapped_in
/ 10000);
46 double ppi_ns_counter_to_double(uint32_t in
) {
48 ret
= (double) in
/ 1000000000;
58 * indent-tabs-mode: nil
61 * ex: set shiftwidth=4 tabstop=8 expandtab:
62 * :indentSize=4:tabSize=8:noTabs=true: