Goby3  3.1.5a
2024.05.23
iridium_rudics_packet.h
Go to the documentation of this file.
1 // Copyright 2009-2023:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 // File authors:
6 // Toby Schneider <toby@gobysoft.org>
7 //
8 //
9 // This file is part of the Goby Underwater Autonomy Project Libraries
10 // ("The Goby Libraries").
11 //
12 // The Goby Libraries are free software: you can redistribute them and/or modify
13 // them under the terms of the GNU Lesser General Public License as published by
14 // the Free Software Foundation, either version 2.1 of the License, or
15 // (at your option) any later version.
16 //
17 // The Goby Libraries are distributed in the hope that they will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public License
23 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
24 
25 #ifndef GOBY_ACOMMS_MODEMDRIVER_RUDICS_PACKET_H
26 #define GOBY_ACOMMS_MODEMDRIVER_RUDICS_PACKET_H
27 
28 #include <cstdint>
29 #include <stdexcept>
30 #include <string>
31 
32 namespace goby
33 {
34 namespace acomms
35 {
36 class RudicsPacketException : public std::runtime_error
37 {
38  public:
39  RudicsPacketException(const std::string& what) : std::runtime_error(what) {}
40 };
41 
42 void serialize_rudics_packet(std::string bytes, std::string* rudics_pkt,
43  const std::string& reserved = std::string("\0\r\n", 3) +
44  std::string(1, 0xff),
45  bool include_crc = true);
46 void parse_rudics_packet(std::string* bytes, std::string rudics_pkt,
47  const std::string& reserved = std::string("\0\r\n", 3) +
48  std::string(1, 0xff),
49  bool include_crc = true);
50 std::string uint32_to_byte_string(uint32_t i);
51 uint32_t byte_string_to_uint32(const std::string& s);
52 } // namespace acomms
53 } // namespace goby
54 
55 #endif
goby::acomms::RudicsPacketException
Definition: iridium_rudics_packet.h:36
goby::acomms::parse_rudics_packet
void parse_rudics_packet(std::string *bytes, std::string rudics_pkt, const std::string &reserved=std::string("\0\r\n", 3)+std::string(1, 0xff), bool include_crc=true)
goby
The global namespace for the Goby project.
Definition: acomms_constants.h:33
goby::acomms::serialize_rudics_packet
void serialize_rudics_packet(std::string bytes, std::string *rudics_pkt, const std::string &reserved=std::string("\0\r\n", 3)+std::string(1, 0xff), bool include_crc=true)
goby::acomms::RudicsPacketException::RudicsPacketException
RudicsPacketException(const std::string &what)
Definition: iridium_rudics_packet.h:39
goby::acomms::uint32_to_byte_string
std::string uint32_to_byte_string(uint32_t i)
goby::acomms::byte_string_to_uint32
uint32_t byte_string_to_uint32(const std::string &s)