DESERT 3.5.1
Loading...
Searching...
No Matches
uwrov-packet.h
Go to the documentation of this file.
1//
2// Copyright (c) 2014 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28//
29
42extern packet_t PT_UWROV;
43extern packet_t PT_UWROV_CTR;
47typedef struct hdr_uwROV_ctr {
48 float x_;
49 float y_;
50 float z_;
51 float speed_;
52 double sn_; // sequence number
53
54 static int offset_;
59 inline static int& offset() {
60 return offset_;
61 }
62
63 inline static struct hdr_uwROV_ctr * access(const Packet * p) {
64 return (struct hdr_uwROV_ctr*) p->access(offset_);
65 }
66
67 inline float& x() {
68 return x_;
69 }
70
71 inline float& y() {
72 return y_;
73 }
74
75 inline float& z() {
76 return z_;
77 }
78
79 inline float& speed() {
80 return speed_;
81 }
82 inline double& sn() {
83 return sn_;
84 }
86
90typedef struct hdr_uwROV_monitoring {
91 float x_;
92 float y_;
93 float z_;
94 double ack_; // ack piggybacked of a ctr message. If =0 is not ack, if =b>0 is cumulative ack untill b, if c<0 is cumulative ack untill c-1 and NACK c.
95
96 static int offset_;
101 inline static int& offset() {
102 return offset_;
103 }
104
105 inline static struct hdr_uwROV_monitoring * access(const Packet * p) {
106 return (struct hdr_uwROV_monitoring*) p->access(offset_);
107 }
108
109 inline float& x() {
110 return x_;
111 }
112
113 inline float& y() {
114 return y_;
115 }
116
117 inline float& z() {
118 return z_;
119 }
120
121 inline double& ack() {
122 return ack_;
123 }
124
hdr_uwROV_ctr describes UWROV_ctr packets for controlling the ROV.
float & z()
static int offset_
Required by the PacketHeaderManager.
double & sn()
float & speed()
static int & offset()
Reference to the offset_ variable.
float & x()
float & y()
static struct hdr_uwROV_ctr * access(const Packet *p)
hdr_uwROV_monitoring describes UWROV_monitoring packets sent by the ROV to the base station for monit...
static int offset_
Required by the PacketHeaderManager.
static struct hdr_uwROV_monitoring * access(const Packet *p)
static int & offset()
Reference to the offset_ variable.
packet_t PT_UWROV
packet_t PT_UWROV_CTR