SELKIELogger  1.0.0
N2KMessages.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Swansea University
3  *
4  * This file is part of the SELKIELogger suite of tools.
5  *
6  * SELKIELogger is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation, either version 3 of the License, or (at your option)
9  * any later version.
10  *
11  * SELKIELogger is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this SELKIELogger product.
18  * If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef SELKIELoggerN2K_Messages
22 #define SELKIELoggerN2K_Messages
23 
29 #include "SELKIELoggerBase.h"
30 #include <stdbool.h>
31 #include <stdint.h>
32 
33 #include "N2KTypes.h"
34 
41 #define N2K_TO_DEGREES 0.0057295779513082332
42 
49 int8_t n2k_get_int8(const n2k_act_message *n, size_t offset);
50 
52 uint8_t n2k_get_uint8(const n2k_act_message *n, size_t offset);
53 
55 int16_t n2k_get_int16(const n2k_act_message *n, size_t offset);
56 
58 uint16_t n2k_get_uint16(const n2k_act_message *n, size_t offset);
59 
61 int32_t n2k_get_int32(const n2k_act_message *n, size_t offset);
62 
64 uint32_t n2k_get_uint32(const n2k_act_message *n, size_t offset);
65 
67 int64_t n2k_get_int64(const n2k_act_message *n, size_t offset);
68 
70 uint64_t n2k_get_uint64(const n2k_act_message *n, size_t offset);
71 
73 double n2k_get_double(const n2k_act_message *n, size_t offset, uint8_t size);
74 
76 double n2k_get_udouble(const n2k_act_message *n, size_t offset, uint8_t size);
78 
85 bool n2k_60928_values(const n2k_act_message *n, uint32_t *id, uint16_t *mfr, uint8_t *inst, uint8_t *fn, uint8_t *class,
86  uint8_t *sys, uint8_t *ind, bool *cfg);
87 
89 bool n2k_127250_values(const n2k_act_message *n, uint8_t *seq, double *hdg, double *dev, double *var, uint8_t *ref);
90 
92 bool n2k_127251_values(const n2k_act_message *n, uint8_t *seq, double *rate);
93 
95 bool n2k_127257_values(const n2k_act_message *n, uint8_t *seq, double *yaw, double *pitch, double *roll);
96 
98 bool n2k_128267_values(const n2k_act_message *n, uint8_t *seq, double *depth, double *offset, double *range);
99 
101 bool n2k_129025_values(const n2k_act_message *n, double *lat, double *lon);
102 
104 bool n2k_129026_values(const n2k_act_message *n, uint8_t *seq, uint8_t *mag, double *course, double *speed);
105 
107 bool n2k_129029_values(const n2k_act_message *n, uint8_t *seq, uint16_t *epochDays, double *seconds, double *lat,
108  double *lon, double *alt, uint8_t *type, uint8_t *method, uint8_t *integ, uint8_t *nsv,
109  double *hdop, double *pdop, double *geos, uint8_t *rs, uint8_t *rst, uint16_t *rsid,
110  double *dgnssa);
111 
113 bool n2k_129033_values(const n2k_act_message *n, uint16_t *epochDays, double *seconds, int16_t *utcMins);
114 
116 bool n2k_130306_values(const n2k_act_message *n, uint8_t *seq, uint8_t *ref, double *speed, double *angle);
117 
119 bool n2k_130311_values(const n2k_act_message *n, uint8_t *seq, uint8_t *tid, uint8_t *hid, double *temp, double *humid,
120  double *press);
121 
123 void n2k_header_print(const n2k_act_message *n, const char d);
124 
126 void n2k_basic_print(const n2k_act_message *n);
127 
129 void n2k_60928_print(const n2k_act_message *n);
130 
132 void n2k_127250_print(const n2k_act_message *n);
133 
135 void n2k_127251_print(const n2k_act_message *n);
136 
138 void n2k_127257_print(const n2k_act_message *n);
139 
141 void n2k_128267_print(const n2k_act_message *n);
142 
144 void n2k_129025_print(const n2k_act_message *n);
145 
147 void n2k_129026_print(const n2k_act_message *n);
148 
150 void n2k_129029_print(const n2k_act_message *n);
151 
153 void n2k_129033_print(const n2k_act_message *n);
154 
156 void n2k_130306_print(const n2k_act_message *n);
157 
159 void n2k_130311_print(const n2k_act_message *n);
161 
163 #endif
bool n2k_127251_values(const n2k_act_message *n, uint8_t *seq, double *rate)
Extract values from PGN 127251: Rate of Turn.
Definition: N2KMessages.c:243
void n2k_basic_print(const n2k_act_message *n)
Print basic PGN details to standard output.
Definition: N2KMessages.c:563
void n2k_128267_print(const n2k_act_message *n)
Print PGN 128267 (Water depth) to standard output.
Definition: N2KMessages.c:635
void n2k_129029_print(const n2k_act_message *n)
Print PGN 129029 (GNSS Position) to standard output.
Definition: N2KMessages.c:697
void n2k_130311_print(const n2k_act_message *n)
Print PGN 130311 (Environmental data) to standard output.
Definition: N2KMessages.c:795
void n2k_129026_print(const n2k_act_message *n)
Print PGN 129026 (Course and Speed) to standard output.
Definition: N2KMessages.c:667
void n2k_129025_print(const n2k_act_message *n)
Print PGN 129025 (Device position) to standard output.
Definition: N2KMessages.c:652
void n2k_130306_print(const n2k_act_message *n)
Print PGN 130306 (Wind speed and direction) to standard output.
Definition: N2KMessages.c:759
bool n2k_130311_values(const n2k_act_message *n, uint8_t *seq, uint8_t *tid, uint8_t *hid, double *temp, double *humid, double *press)
Extract values from PGN 130311: Environmental data.
Definition: N2KMessages.c:501
void n2k_60928_print(const n2k_act_message *n)
Print PGN 60928 (Address claim) to standard output.
Definition: N2KMessages.c:527
bool n2k_129025_values(const n2k_act_message *n, double *lat, double *lon)
Extract values from PGN 129025: Device position.
Definition: N2KMessages.c:320
bool n2k_130306_values(const n2k_act_message *n, uint8_t *seq, uint8_t *ref, double *speed, double *angle)
Extract values from PGN 130306: Wind speed and direction.
Definition: N2KMessages.c:470
void n2k_127250_print(const n2k_act_message *n)
Print PGN 127250 (Vessel Heading) to standard output.
Definition: N2KMessages.c:572
void n2k_header_print(const n2k_act_message *n, const char d)
Print common message elements.
Definition: N2KMessages.c:549
bool n2k_129029_values(const n2k_act_message *n, uint8_t *seq, uint16_t *epochDays, double *seconds, double *lat, double *lon, double *alt, uint8_t *type, uint8_t *method, uint8_t *integ, uint8_t *nsv, double *hdop, double *pdop, double *geos, uint8_t *rs, uint8_t *rst, uint16_t *rsid, double *dgnssa)
Extract values from PGN 129029: GNSS Position.
Definition: N2KMessages.c:380
void n2k_127251_print(const n2k_act_message *n)
Print PGN 127251 (Rate of Turn) to standard output.
Definition: N2KMessages.c:604
bool n2k_127250_values(const n2k_act_message *n, uint8_t *seq, double *hdg, double *dev, double *var, uint8_t *ref)
Extract values from PGN 127250: Vessel Heading.
Definition: N2KMessages.c:212
bool n2k_127257_values(const n2k_act_message *n, uint8_t *seq, double *yaw, double *pitch, double *roll)
Extract values from PGN 127257: Device orientation.
Definition: N2KMessages.c:264
bool n2k_129033_values(const n2k_act_message *n, uint16_t *epochDays, double *seconds, int16_t *utcMins)
Extract values from PGN 129033: Date/Time.
Definition: N2KMessages.c:448
bool n2k_128267_values(const n2k_act_message *n, uint8_t *seq, double *depth, double *offset, double *range)
Extract values from PGN 128267: Water depth.
Definition: N2KMessages.c:291
void n2k_127257_print(const n2k_act_message *n)
Print PGN 127257 (Device orientation) to standard output.
Definition: N2KMessages.c:618
bool n2k_129026_values(const n2k_act_message *n, uint8_t *seq, uint8_t *mag, double *course, double *speed)
Extract values from PGN 129026: Course and speed.
Definition: N2KMessages.c:342
bool n2k_60928_values(const n2k_act_message *n, uint32_t *id, uint16_t *mfr, uint8_t *inst, uint8_t *fn, uint8_t *class, uint8_t *sys, uint8_t *ind, bool *cfg)
Extract values from PGN 60928: ISO Adddress Claim.
Definition: N2KMessages.c:187
void n2k_129033_print(const n2k_act_message *n)
Print PGN 129033 (Date and Time) to standard output.
Definition: N2KMessages.c:737
uint16_t n2k_get_uint16(const n2k_act_message *n, size_t offset)
Extract unsigned 16-bit integer from N2K Message.
Definition: N2KMessages.c:67
int16_t n2k_get_int16(const n2k_act_message *n, size_t offset)
Extract signed 16-bit integer from N2K Message.
Definition: N2KMessages.c:55
double n2k_get_double(const n2k_act_message *n, size_t offset, uint8_t size)
Extract double from underlying integer data.
Definition: N2KMessages.c:125
double n2k_get_udouble(const n2k_act_message *n, size_t offset, uint8_t size)
Extract double from underlying unsigned integer data.
Definition: N2KMessages.c:153
int8_t n2k_get_int8(const n2k_act_message *n, size_t offset)
Extract signed byte from N2K Message.
Definition: N2KMessages.c:43
uint32_t n2k_get_uint32(const n2k_act_message *n, size_t offset)
Extract unsigned 32-bit integer from N2K Message.
Definition: N2KMessages.c:88
uint64_t n2k_get_uint64(const n2k_act_message *n, size_t offset)
Extract unsigned 64-bit integer from N2K Message.
Definition: N2KMessages.c:111
int64_t n2k_get_int64(const n2k_act_message *n, size_t offset)
Extract signed 64-bit integer from N2K Message.
Definition: N2KMessages.c:99
int32_t n2k_get_int32(const n2k_act_message *n, size_t offset)
Extract signed 32-bit integer from N2K Message.
Definition: N2KMessages.c:76
uint8_t n2k_get_uint8(const n2k_act_message *n, size_t offset)
Extract unsigned byte from N2K Message.
Definition: N2KMessages.c:34