DESERT 3.5.1
Loading...
Searching...
No Matches
mdriverS2C_Evo_lowlev.h
Go to the documentation of this file.
1//
2// Copyright (c) 2016 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
38#ifndef UWMDRIVERS2CLOWLEVEL_H
39#define UWMDRIVERS2CLOWLEVEL_H
40
41#include <msocket.h>
42#include "minterpreterTEL.h"
43#include <uwmdriver.h>
44#include <queue>
45
63
65
67
69
76{
77
87 std::queue<std::string> queue_tx;
89 std::queue<std::string>
92 int _gain;
93 int _SL;
99 int _th;
103 double
114public:
127 void start();
132 void stop();
136 void setBitrate(int index);
140 void setSourceLevel(int level);
144 void setPktBitLen(int bitlen);
152 void modemTx();
191 virtual void modemSetID();
202 virtual modem_state_t updateStatus();
203
204protected:
209 void modemTxManager();
216};
217#endif
Class containing the basic functions to drive the S2C EvoLogics acoustic modem transmissions/receptio...
int _SL
Variable holding the Source Level of the low level driver.
void modemTxBurst()
Method that notifies the driver that there is a packet to be sent via the modem.
void modemTx()
Method that notifies the driver that there is a packet to be sent via the modem.
ll_tx_state_t m_state_tx
TX state to manage transmission methods.
double _delay
Variable that holds the delay required for doing some operations, e.g., sending a message,...
void modemCfgDSP()
Method that notifies the driver that there is a configuration to be sent to the modem (DSP).
int _chipset
Variable holding the chipset that will be used by the low level firmware.
void start()
Method to let the driver start operations and initialize configurations.
void stop()
Method to stop the driver operations.
int _delay_flag
Variable that holds that flag that triggers the waiting time for some operations e....
Msocket mConnector
Object that handles the physical host to modem communications via TCP/IP sockets.
std::queue< std::string > queue_tx
Queue used to buffer incoming strings for tx messages.
std::queue< std::string > queue_rx
Queue used to buffer incoming strings for rx messages.
ll_rx_state_t m_state_rx
RX state to manage reception methods.
void setBitrate(int index)
Method to set the bitrate that will be sent to the modem config.
void setPktBitLen(int bitlen)
Method to set the msg bitlength that will be received by rx.
int _gain
Variable holding the Gain level of the low level driver.
virtual modem_state_t updateStatus()
Method to update modem status.
int _th
Variable holding the threshold used by the low level firmware.
~MdriverS2C_Evo_lowlev()
Class destructor.
void setSourceLevel(int level)
Method to set the source level that will be sent to the modem config.
void updateTxState(ll_tx_state_t)
Method for updating the state after a significant change, namely: a configuration of the firmware par...
void modemCfgBitrate()
Method that notifies the driver that there is a configuration to be sent to the modem (Bitrate).
int _mps_th
Variable holding the MPS treshold used by the low level firmware.
void modemTxPBM()
Method that notifies the driver that there is a packet to be sent via the modem.
virtual void modemSetID()
Method to set the ID of the modem.
int _msg_bitlen
Very very temporary parameter to let the receiver not screw up and read only the, known,...
void modemTxManager()
Method that manages the transmission of TELEGRAMS and configurations via GPIOs to the modem.
int _bitrate_i
Variable holding the bitrate index of the low level firmware.
MinterpreterTEL mInterpreter
Object that builds/parses TELEGRAMS and GPIO settings.
Class used to build and parse TELEGRAMS (this class derives UWMinterpreter); currently,...
Class used to manage host/modem string exchange via TCP/IP connection (this class is a derived class ...
The main class implementing the module used to implement the interface between ns2/NS-Miracle and rea...
The class needed by UWMPhy_modem to handle the different transmissions cases and corresponding protoc...
enum LL_STATE_RX ll_rx_state_t
@ TX_STATE_CTRL
@ TX_STATE_ASK_BUSY
@ TX_STATE_IDLE
@ TX_STATE_CLEAR_TX
@ TX_STATE_BITRATE_CFG
@ TX_STATE_OFF1
@ TX_STATE_OFF3
@ TX_STATE_OFF2
@ TX_STATE_DSP_CFG
@ TX_STATE_DATA
@ TX_STATE_STOP_LISTEN
enum LL_STATE_TX ll_tx_state_t
@ RX_STATE_DATA
@ RX_STATE_IDLE
Class that is in charge of building and parsing the required messages to make the UWMdriver able to c...