DESERT 3.5.1
Loading...
Searching...
No Matches
uwahoimodem.cpp
Go to the documentation of this file.
1//
2// Copyright (c) 2019 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#include <ahoitypes.h>
30#include <clmessage.h>
31#include <hdr-uwal.h>
32#include <mphy_timers.h>
33#include <uwahoimodem.h>
34#include <uwal.h>
35#include <uwphy-clmsg.h>
36#include <uwserial.h>
37
38#include <algorithm>
39#include <cstring>
40#include <iostream>
41#include <iterator>
42
43const std::chrono::milliseconds UwAhoiModem::MODEM_TIMEOUT =
44 std::chrono::milliseconds(3600);
45
47
49
50uint8_t UwAhoiModem::sn = 0;
51
56static class UwAhoiModem_TclClass : public TclClass
57{
58
59public:
61 : TclClass("Module/UW/UwModem/AHOI")
62 {
63 }
64
65 TclObject *
66 create(int args, const char *const *argv)
67 {
68 return (new UwAhoiModem());
69 }
70
72
74 : UwModem()
75 , p_connector(new UwSerial())
76 , p_interpreter(new UwInterpreterAhoi(id))
77 , status(ModemState::AVAILABLE)
78 , tx_status(TransmissionState::TX_IDLE)
79 , status_m()
80 , tx_status_m()
81 , tx_queue_m()
82 , status_cv()
83 , tx_status_cv()
84 , tx_queue_cv()
85 , receiving(false)
86 , transmitting(false)
87 , rx_thread()
88 , tx_thread()
89 , rx_payload("")
90 , virtual_time_ref(0.0)
91 , WAIT_DELIVERY(std::chrono::milliseconds(3000))
92 , tmpPacket{0}
93 , id(0)
94 , parity_bit(0)
95 , stop_bit(0)
96 , flow_control(0)
97 , baud_rate(115200)
98 , power(0)
99 , rssi(0)
100 , bit_errors(0)
101 , agc_mean(0)
102 , agc_min(0)
103 , agc_max(0)
104{
105 bind("buffer_size", (int *) &DATA_BUFFER_LEN);
106 bind("max_read_size", (int *) &MAX_READ_BYTES);
107 bind("parity_bit", (int *) &parity_bit);
108 bind("stop_bit", (int *) &stop_bit);
109 bind("flow_control", (int *) &flow_control);
110 bind("baud_rate", (int *) &baud_rate);
111 bind("modem_id", (int *) &id);
112 bind("max_n_retx", (int *) &MAX_RETX);
113 bind("wait_delivery", (uint *) &UwAhoiModem::WAIT_DELIVERY_INT);
114}
115
120
121void
123{
124 // push new incoming pck into tx_queue
125 hdr_cmn *ch = HDR_CMN(p);
126 hdr_MPhy *ph = HDR_MPHY(p);
127
128 if (ch->direction() == hdr_cmn::UP) {
129 if (isOn == true) {
130 startRx(p);
131 endRx(p);
132 } else {
133 Packet::free(p);
134 }
135 } else { // DOWN
136 if (!isOn) {
137 return;
138 }
139 ph->Pr = 0;
140 ph->Pn = 0;
141 ph->Pi = 0;
142 ph->txtime = NOW;
143 ph->rxtime = ph->txtime;
144
145 ph->worth_tracing = false;
146
147 ph->srcSpectralMask = getTxSpectralMask(p);
148 ph->srcAntenna = getTxAntenna(p);
149 ph->srcPosition = getPosition();
150 ph->dstSpectralMask = 0;
151 ph->dstPosition = 0;
152 ph->dstAntenna = 0;
153 ph->modulationType = getModulationType(p);
154
155 std::unique_lock<std::mutex> tx_lock(tx_queue_m);
156 tx_queue.push(p);
157 tx_lock.unlock();
158 printOnLog(LogLevel::DEBUG, "AHOIMODEM", "recv::PUSHING_IN_TX_QUEUE");
159 tx_queue_cv.notify_one();
160 }
161}
162
163int
164UwAhoiModem::command(int argc, const char *const *argv)
165{
166 return UwModem::command(argc, argv);
167}
168
169int
171{
172 return 0;
173}
174
175void
177{
178 ahoi::packet_t ahoiPkt = {0};
179 ahoiPkt = fillAhoiPkt(p);
180
181 std::string cmd_s = p_interpreter->buildSend(ahoiPkt);
182
183 // write the obtained command to the device, through the connector
184 std::unique_lock<std::mutex> tx_state_lock(tx_status_m);
185
186 if (!tx_status_cv.wait_for(tx_state_lock, WAIT_DELIVERY, [&]
187 { return tx_status == TransmissionState::TX_IDLE; })) {
188
190 printOnLog(LogLevel::DEBUG, "AHOIMODEM",
191 "startTx::FORCING_TX_STATUS_IDLE");
192 }
193
195
196 printOnLog(LogLevel::DEBUG, "AHOIMODEM", "startTx::SENDING_PACKET");
197 if ((p_connector->writeToDevice(cmd_s)) < 0) {
199 "AHOIMODEM",
200 "startTx::FAIL_TO_WRITE_TO_DEVICE::[" + cmd_s + "]");
201 return;
202 }
203
204 // retry if the tx_status does not appear to slip to TX_IDLE
205 std::chrono::milliseconds WAIT_DELIVERY(WAIT_DELIVERY_INT);
206 uint n_retx = 1;
207 while (n_retx <= MAX_RETX &&
208 !(tx_status_cv.wait_for(tx_state_lock, WAIT_DELIVERY, [&] {
209 return tx_status == TransmissionState::TX_IDLE;
210 }))) {
211
213 "AHOIMODEM",
214 "startTx::SENDING_PACKET[" + std::to_string(n_retx) + "]");
215
217
218 if ((p_connector->writeToDevice(cmd_s)) < 0) {
220 "AHOIMODEM",
221 "startTx::FAIL_TO_WRITE_TO_DEVICE::[" + cmd_s + "]");
222 return;
223 }
224 n_retx++;
225 }
226}
227
228ahoi::packet_t
230{
231 hdr_uwal *uwalh = HDR_UWAL(p);
232 hdr_mac* mach = HDR_MAC(p);
233
234 ahoi::packet_t packet = {0};
235
236 std::string payload(uwalh->binPkt(), uwalh->binPktLength());
237
238 ahoi::header_t header;
239 header.src = (unsigned int)modemID;
240 header.dst = mach->macDA();
242 header.status = ahoi::ACK_NONE;
243 header.dsn = sn;
244 header.len = static_cast<uint8_t>(payload.length());
245
246 packet.header = header;
247 for (uint i = 0; i < payload.size(); i++) {
248 packet.payload[i] = (uint8_t) payload[i];
249 }
250
251 return packet;
252}
253
254void
256{
257 printOnLog(LogLevel::INFO, "UWAHOIMODEM", "startRx::PHY2MACSTARTRX");
258 Phy2MacStartRx(p);
259}
260
261void
263{
264 printOnLog(LogLevel::INFO, "UWAHOIMODEM", "endRx::SENDUP");
265 sendUp(p, 0.01);
266}
267
268void
270{
271 if (modem_address == "") {
272 printOnLog(LogLevel::ERROR, "AHOIMODEM", "start::PORT_NOT_SET");
273 return;
274 }
275
276 //generate complete path with parameters for serial connection
277 if (parity_bit)
278 modem_address = modem_address + ":p=1";
279 else
280 modem_address = modem_address + ":p=0";
281
282 if (stop_bit)
283 modem_address = modem_address + ":s=1";
284 else
285 modem_address = modem_address + ":s=0";
286
287 if (flow_control)
288 modem_address = modem_address + ":f=1";
289 else
290 modem_address = modem_address + ":f=0";
291
292 if (baud_rate > 0)
293 modem_address = modem_address + ":b=" + std::to_string(baud_rate);
294 else {
296 LogLevel::ERROR, "AHOIMODEM", "start::BAUD_RATE_NOT_VALID");
297 exit(1);
298 }
299
300
301 if (!p_connector->openConnection(modem_address)) {
303 LogLevel::ERROR, "AHOIMODEM", "start::CONNECTION_OPEN_FAILED");
304 exit(1);
305 }
306
307 // set flags to true so loops can start
308 receiving.store(true);
309 transmitting.store(true);
310
311 // spawn off threads
312 rx_thread = std::thread(&UwAhoiModem::receivingData, this);
313 tx_thread = std::thread(&UwAhoiModem::transmittingData, this);
314
315 checkTimer = new CheckTimer(this);
316 checkTimer->resched(period);
317
318 printOnLog(LogLevel::INFO, "AHOIMODEM", "start::STARTING_OPERATIONS");
319}
320
321void
323{
324 printOnLog(LogLevel::INFO, "AHOIMODEM", "stop::CLOSING_CONNECTION");
325
326 receiving.store(false);
327 transmitting.store(false);
328 tx_queue_cv.notify_one();
329 if (tx_thread.joinable())
330 tx_thread.join();
331 if (p_connector->isConnected() && !p_connector->closeConnection()) {
332 printOnLog(LogLevel::ERROR, "AHOIMODEM", "stop::CONNECTION_CLOSE_FAIL");
333 }
334 if (rx_thread.joinable()) {
335 rx_thread.join();
336 }
337
338 checkTimer->force_cancel();
339}
340
341void
343{
344 while (transmitting.load()) {
345
346 std::unique_lock<std::mutex> tx_q_lock(tx_queue_m);
347 tx_queue_cv.wait(
348 tx_q_lock, [&] { return !tx_queue.empty() || !transmitting; });
349 if (!transmitting) {
350 break;
351 }
352
353 Packet *pck = tx_queue.front();
354 tx_queue.pop();
355 tx_q_lock.unlock();
356
357 if (pck) {
358
359 std::unique_lock<std::mutex> state_lock(status_m);
360 if (!status_cv.wait_for(state_lock, MODEM_TIMEOUT, [&] {
361 return status == ModemState::AVAILABLE;
362 })) {
363
366 "AHOIMODEM",
367 "transmittingData::FORCING_MODEM_AVAILABILITY");
368 }
369
371 state_lock.unlock();
372 startTx(pck);
373
374 } else {
375 printOnLog(LogLevel::DEBUG, "AHOIMODEM",
376 "transmittingData::INVALID_PACKET_RETRIEVED");
377 }
378
379 updateSN();
380
381 // schedule call to endTx in events queue
382 std::function<void(UwModem &, Packet * p)> callback =
384 ModemEvent e = {callback, pck};
385 event_q.push(e);
386
387 printOnLog(LogLevel::DEBUG, "AHOIMODEM",
388 "transmittingData::BLOCKING_ON_NEXT_PACKET");
389 }
390}
391
392void
394{
396 std::fill(data_buffer.begin(), data_buffer.end(), '\0');
397 // iterators that keep track of read/write operations
398 std::vector<char>::iterator beg_it = data_buffer.begin();
399 std::vector<char>::iterator end_it = data_buffer.begin();
400 // iterators that keep track of commands research
401 std::vector<char>::iterator cmd_b = data_buffer.begin();
402 std::vector<char>::iterator cmd_e = data_buffer.begin();
403 int r_bytes = 0; // bytes read from the device interface
404 int offset = 0; // offset to not overwrite unparsed data
405
406 std::shared_ptr<ahoi::packet_t> pck = std::make_shared<ahoi::packet_t>();
407
408 while (receiving.load()) {
409
410 r_bytes = p_connector->readFromDevice(
411 &(*end_it), MAX_READ_BYTES - offset);
412
413 if (r_bytes < 0) {
414 if (p_connector->getErrno() != 0) {
416 "AHOIMODEM",
417 strerror(p_connector->getErrno()));
418 }
419 r_bytes = 0;
420 }
421
422 end_it += r_bytes;
423
424 while (p_interpreter->findResponse(
425 beg_it, end_it, cmd_b, cmd_e) != "") {
426
427 offset = std::distance(cmd_e, end_it);
428
429 p_interpreter->fixEscapes(data_buffer, cmd_b, cmd_e);
430
431 if ((pck = p_interpreter->parseResponse(cmd_b, cmd_e)) != nullptr) {
432
433 updateStatus(pck);
435 "AHOIMODEM",
436 "receivingData::RX_MSG=" + std::string(cmd_b, cmd_e));
437 }
438
439 offset = std::distance(cmd_e, end_it);
440 std::copy(cmd_e, end_it, beg_it);
441 std::fill(beg_it + offset, end_it, '\0');
442 end_it = beg_it + offset;
443
444 pck.reset();
445 }
446 }
447}
448
449void
451{
452 hdr_uwal *uwalh = HDR_UWAL(p);
453 uwalh->binPktLength() = rx_payload.size();
454 std::memset(uwalh->binPkt(), 0, uwalh->binPktLength());
455 std::copy(rx_payload.begin(), rx_payload.end(), uwalh->binPkt());
456 HDR_CMN(p)->direction() = hdr_cmn::UP;
457 rx_payload = ""; // clean up the rx payload string
458}
459
460bool
461UwAhoiModem::storePacketInfo(std::shared_ptr<ahoi::packet_t> packet, Packet *p)
462{
463 ahoi::header_t header = packet->header;
464 ahoi::footer_t footer = packet->footer;
465
466 hdr_uwal *uwalh = HDR_UWAL(p);
467 uwalh->srcID() = header.src;
468
469 if (header.type == 0x00) {
470
471 rx_payload = "";
472 for (int i = 0; i < header.len; i++) {
473 rx_payload += packet->payload[i];
474 }
475 power = footer.power;
476 rssi = footer.rssi;
477 bit_errors = footer.biterrors;
478 agc_mean = footer.agcMean;
479 agc_min = footer.agcMin;
480 agc_max = footer.agcMax;
481
483 "AHOIMODEM", "storePacketInfo::PAYLOAD[" + rx_payload + "]");
484 }
485
486 return true;
487}
488
489bool
490UwAhoiModem::parseFooter(std::shared_ptr<ahoi::footer_t> footer)
491{
492 power = footer->power;
493 rssi = footer->rssi;
494 bit_errors = footer->biterrors;
495 agc_mean = footer->agcMean;
496 agc_min = footer->agcMin;
497 agc_max = footer->agcMax;
498
499 return true;
500}
501
502void
503UwAhoiModem::updateStatus(std::shared_ptr<ahoi::packet_t> packet)
504{
505
506 uint8_t packet_type = (packet->header).type;
507 auto cmd = std::find_if(ahoi::commands_id.begin(),
508 ahoi::commands_id.end(),
509 [&packet_type](const std::pair<ahoi::Command, uint8_t> &p) {
510 return p.second == packet_type;
511 });
512
513 if (cmd == ahoi::commands_id.end()) {
515 "AHOIMODEM",
516 "updateStatus::UNKNOWN_COMMAND_RECEIVED");
517 }
518
519 std::string dbg_str = std::string("updateStatus::HEADER::") +
520 "[SRC::" + std::to_string((packet->header).src) +
521 "][DST::" + std::to_string((packet->header).dst) +
522 "][TYP::" + std::to_string((packet->header).type) +
523 "][DSN::" + std::to_string((packet->header).dsn) +
524 "][LEN::" + std::to_string((packet->header).len) + "]";
525 printOnLog(LogLevel::DEBUG, "AHOIMODEM", dbg_str);
526
527 std::lock(status_m, tx_status_m);
528 std::unique_lock<std::mutex> state_lock(status_m, std::adopt_lock);
529 std::unique_lock<std::mutex> tx_state_lock(tx_status_m, std::adopt_lock);
530
531 // Set the modem status to available, then proceed to check the cmd type
533 status_cv.notify_all();
534 state_lock.unlock();
535
536 switch (cmd->first) {
537 case ahoi::Command::send: {
538
539 Packet *p = Packet::alloc();
540
541 if (packet->header.dst == modemID || packet->header.dst == 0xFF) {
542
543 storePacketInfo(packet, p);
545
546 std::function<void(UwModem &, Packet * p)> callback =
548 ModemEvent e = {callback, p};
549 event_q.push(e);
550
551 }
552
553 break;
554
555 }
557 if ((packet->header).src == modemID && (packet->header).dsn == sn) {
558
560 tx_status_cv.notify_all();
561 tx_state_lock.unlock();
562 } else {
563 std::string err_str = "WRONG_RESPONSE::[" +
564 p_interpreter->serializePacket(packet.get()) + "]";
565 printOnLog(LogLevel::ERROR, "AHOIMODEM", err_str);
566 }
567 break;
568 }
569 default: {
570 printOnLog(LogLevel::ERROR, "AHOIMODEM",
571 "updateStatus::UNMANAGED_CMD_TYPE");
572 }
573 }
574}
575
576void
578{
579 sn++;
580 printOnLog(LogLevel::ERROR, "AHOIMODEM",
581 "updateSN::CURRENT_SEQ_NUM::[" + std::to_string(sn) + "]");
582}
Class to create the Otcl shadow object for an object of the class UwAhoiModem.
TclObject * create(int args, const char *const *argv)
The ahoi! modems are an underwater acoustic modems developed by TUUH University, Hamburg by the Smart...
Definition uwahoimodem.h:57
void updateSN()
Method for Sequence Number (SN) update.
int stop_bit
flag for stop bit
virtual void endRx(Packet *p)
Method that ends a packet reception.
UwAhoiModem()
Constructor of the UwAhoiModem class.
TransmissionState
Enum type for the trasnmission state.
Definition uwahoimodem.h:72
ModemState
Enum type for the modem general state.
Definition uwahoimodem.h:65
std::condition_variable tx_status_cv
Condition variable to wait for TransmissionState::TX_IDLE.
virtual void startTx(Packet *p)
Method that triggers the transmission of a packet through a specified modem.
std::mutex tx_queue_m
Mutex associated with the transmission queue.
ahoi::packet_t fillAhoiPkt(Packet *p)
Method that fills the fields of an ahoi! packet with the needed values, so that later it can be seria...
std::unique_ptr< UwConnector > p_connector
Pointer to Connector object that interfaces with the device.
virtual int command(int argc, const char *const *argv)
Tcl command interpreter: Method that maps Tcl commands into C++ methods.
uint rssi
RSSI vs an "ideal packet".
virtual void stop()
Method that stops the driver operations.
virtual int recvSyncClMsg(ClMessage *m)
Cross-Layer messages synchronous interpreter.
uint power
Received power (RMSE) ratio and "ideal packet".
virtual void start()
Method that starts the driver operations.
uint agc_max
Maximum gain set by the AGC (if used) in reception of the last packet.
std::mutex tx_status_m
Mutex associated with the state machine of the transmission process.
uint bit_errors
Number of repaired bit errors during reception in the last packet.
void createRxPacket(Packet *p)
Method that fills up a packet with the needed header and payload and makes it ready to be sent to the...
bool storePacketInfo(std::shared_ptr< ahoi::packet_t > header, Packet *p)
Method that extarcts fields from a provided ahoi! packet and save the info values to class field for ...
std::mutex status_m
Mutex associated with the state machine of the modem.
uint agc_mean
Mean gain set by the AGC (if used) in reception of the last packet.
std::atomic< bool > receiving
Atomic boolean variable that controls the receiving looping thread.
static uint MAX_RETX
Maximum number of retransmissions for the same packet.
std::chrono::milliseconds WAIT_DELIVERY
Time interval to wait for the modem notifying the response of a given packet.
ModemState status
Variable holding the current status of the modem.
static uint WAIT_DELIVERY_INT
Time interval matching the WAIT_DELIVERY variable: version of type int to match the chrono one,...
int flow_control
flag for flow control
virtual void transmittingData()
Method that detach a thread devoted to sending packets found in tx_queue.
static const std::chrono::milliseconds MODEM_TIMEOUT
Maximum time to wait for modem to become ModemState::AVAILABLE.
std::condition_variable tx_queue_cv
Condition variable that is linked with the transmitting queue.
virtual ~UwAhoiModem()
Destructor of the UwAhoiModem class.
uint agc_min
Minimum gain set by the AGC (if used) in reception of the last packet.
std::unique_ptr< UwInterpreterAhoi > p_interpreter
Pointer to Interpreter object to parse device syntax.
virtual void startRx(Packet *p)
Method that starts a packet reception.
std::atomic< bool > transmitting
Atomic boolean variable that controls the transmitting looping thread.
std::thread rx_thread
Object with the rx thread.
std::thread tx_thread
Object with the tx thread.
int parity_bit
flag for parity bit
std::condition_variable status_cv
Condition variable to wait for ModemState::AVAILABLE.
void updateStatus(std::shared_ptr< ahoi::packet_t > packet)
Method that updates the status of the modem State Machine: state change is triggered by recepting the...
std::string rx_payload
String that is updated witn each new received messsage.
virtual void receivingData()
Mehod that detach a thread devoted to receiving data from the connector.
TransmissionState tx_status
Variable holding the current transmission status of the modem.
int baud_rate
Integer for port baud rate.
static uint8_t sn
Sequence number, which follows all the packets transmitted to the modem.
bool parseFooter(std::shared_ptr< ahoi::footer_t > footer)
Method that extarcts fields from a provided ahoi! packet and save the info values to class field for ...
virtual void recv(Packet *p)
Method that handles the reception of packets arriving from upper layers of the network simulator.
Class used for building syntactically compliant commands to send to the ahoi! modems and interpreting...
Class that implements the interface to DESERT, as used through Tcl scripts.
Definition uwmodem.h:62
void realTxEnded(Packet *p)
Method to call endTx from end of real packet transmission.
Definition uwmodem.h:219
friend class CheckTimer
Definition uwmodem.h:63
std::string modem_address
String containing the address needed to connect to the device In case of socket, it may be expressed ...
Definition uwmodem.h:252
virtual void recv(Packet *p)=0
Method that handles the reception of packets arriving from the upper layers of the network simulator.
std::queue< ModemEvent > event_q
Queue of events that are scheduled for NS2 to execute (callbacks)
Definition uwmodem.h:269
int MAX_READ_BYTES
Maximum number of bytes to be read by a single dump of data.
Definition uwmodem.h:245
CheckTimer * checkTimer
Pointer to an object to schedule the "check-modem" events.
Definition uwmodem.h:265
std::queue< Packet * > tx_queue
Modem's transmission queue: holds packets that are to be transmitted.
Definition uwmodem.h:234
void printOnLog(LogLevel log_level, string module, string message)
Function that, given the appropriate level of log, prints to the set log file the provided log messag...
Definition uwmodem.cpp:102
unsigned int DATA_BUFFER_LEN
Size of the buffer that holds data.
Definition uwmodem.h:242
virtual int getModulationType(Packet *P)
Method that should return the modulation type used for the packet being transmitted.
Definition uwmodem.h:152
virtual int command(int argc, const char *const *argv)
Tcl command interpreter: Method that maps Tcl commands into C++ methods.
Definition uwmodem.cpp:127
std::vector< char > data_buffer
Char buffer (vector) that holds data read from the modem (unparsed data) Main container for data rece...
Definition uwmodem.h:231
int modemID
Number used for identification purposes: not specified.
Definition uwmodem.h:225
double period
Checking period of the modem's buffer.
Definition uwmodem.h:267
Class that implements serial port connection.
Definition uwserial.h:53
Header of the class providing the Uwal header's description.
#define HDR_UWAL(p)
Definition hdr-uwal.h:43
constexpr uint ACK_NONE
Definition ahoitypes.h:104
std::map< ahoi::Command, uint8_t > commands_id
hdr_uwal describes the packet header used by Uwal objects.
Definition hdr-uwal.h:52
char * binPkt()
Return to the binPkt_ array pointer.
Definition hdr-uwal.h:141
uint8_t & srcID()
Reference to the srcID_ variable.
Definition hdr-uwal.h:96
uint32_t & binPktLength()
Reference to the binPktLength_ variable.
Definition hdr-uwal.h:150
UwAhoiModem_TclClass class_ahoimodem
Driver for ahoi! acoustic UW modems: developed by TUUH, Hamburg.
Header of the main class that implements the adaptation layer between ns2/NS-Miracle and binary data ...
Definition of ClMsgUwMmac class.
This implements a generic serial connector .