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