RadioHead

Committer:
danjulio
Date:
Sun Jun 11 04:05:05 2017 +0000
Revision:
0:e69d086cb053
Initial commit of minimally ported Radiohead library using swspi

Who changed what in which revision?

UserRevisionLine numberNew contents of line
danjulio 0:e69d086cb053 1 // RHGenericDriver.h
danjulio 0:e69d086cb053 2 // Author: Mike McCauley (mikem@airspayce.com)
danjulio 0:e69d086cb053 3 // Copyright (C) 2014 Mike McCauley
danjulio 0:e69d086cb053 4 // $Id: RHGenericDriver.h,v 1.19 2017/03/08 09:30:47 mikem Exp mikem $
danjulio 0:e69d086cb053 5 //
danjulio 0:e69d086cb053 6 // Ported to mbed - support only a single radio - Dan Julio - 5/2017
danjulio 0:e69d086cb053 7 //
danjulio 0:e69d086cb053 8
danjulio 0:e69d086cb053 9 #ifndef RHGenericDriver_h
danjulio 0:e69d086cb053 10 #define RHGenericDriver_h
danjulio 0:e69d086cb053 11
danjulio 0:e69d086cb053 12 #include "RadioHead.h"
danjulio 0:e69d086cb053 13 #include "mbed.h"
danjulio 0:e69d086cb053 14 #include "max32630fthr.h"
danjulio 0:e69d086cb053 15 #include <stdint.h>
danjulio 0:e69d086cb053 16
danjulio 0:e69d086cb053 17 // Defines bits of the FLAGS header reserved for use by the RadioHead library and
danjulio 0:e69d086cb053 18 // the flags available for use by applications
danjulio 0:e69d086cb053 19 #define RH_FLAGS_RESERVED 0xf0
danjulio 0:e69d086cb053 20 #define RH_FLAGS_APPLICATION_SPECIFIC 0x0f
danjulio 0:e69d086cb053 21 #define RH_FLAGS_NONE 0
danjulio 0:e69d086cb053 22
danjulio 0:e69d086cb053 23 // Default timeout for waitCAD() in ms
danjulio 0:e69d086cb053 24 #define RH_CAD_DEFAULT_TIMEOUT 10000
danjulio 0:e69d086cb053 25
danjulio 0:e69d086cb053 26 /////////////////////////////////////////////////////////////////////
danjulio 0:e69d086cb053 27 /// \class RHGenericDriver RHGenericDriver.h <RHGenericDriver.h>
danjulio 0:e69d086cb053 28 /// \brief Abstract base class for a RadioHead driver.
danjulio 0:e69d086cb053 29 ///
danjulio 0:e69d086cb053 30 /// This class defines the functions that must be provided by any RadioHead driver.
danjulio 0:e69d086cb053 31 /// Different types of driver will implement all the abstract functions, and will perhaps override
danjulio 0:e69d086cb053 32 /// other functions in this subclass, or perhaps add new functions specifically required by that driver.
danjulio 0:e69d086cb053 33 /// Do not directly instantiate this class: it is only to be subclassed by driver classes.
danjulio 0:e69d086cb053 34 ///
danjulio 0:e69d086cb053 35 /// Subclasses are expected to implement a half-duplex, unreliable, error checked, unaddressed packet transport.
danjulio 0:e69d086cb053 36 /// They are expected to carry a message payload with an appropriate maximum length for the transport hardware
danjulio 0:e69d086cb053 37 /// and to also carry unaltered 4 message headers: TO, FROM, ID, FLAGS
danjulio 0:e69d086cb053 38 ///
danjulio 0:e69d086cb053 39 /// \par Headers
danjulio 0:e69d086cb053 40 ///
danjulio 0:e69d086cb053 41 /// Each message sent and received by a RadioHead driver includes 4 headers:
danjulio 0:e69d086cb053 42 /// -TO The node address that the message is being sent to (broadcast RH_BROADCAST_ADDRESS (255) is permitted)
danjulio 0:e69d086cb053 43 /// -FROM The node address of the sending node
danjulio 0:e69d086cb053 44 /// -ID A message ID, distinct (over short time scales) for each message sent by a particilar node
danjulio 0:e69d086cb053 45 /// -FLAGS A bitmask of flags. The most significant 4 bits are reserved for use by RadioHead. The least
danjulio 0:e69d086cb053 46 /// significant 4 bits are reserved for applications.
danjulio 0:e69d086cb053 47 class RHGenericDriver
danjulio 0:e69d086cb053 48 {
danjulio 0:e69d086cb053 49 public:
danjulio 0:e69d086cb053 50 /// \brief Defines different operating modes for the transport hardware
danjulio 0:e69d086cb053 51 ///
danjulio 0:e69d086cb053 52 /// These are the different values that can be adopted by the _mode variable and
danjulio 0:e69d086cb053 53 /// returned by the mode() member function,
danjulio 0:e69d086cb053 54 typedef enum
danjulio 0:e69d086cb053 55 {
danjulio 0:e69d086cb053 56 RHModeInitialising = 0, ///< Transport is initialising. Initial default value until init() is called..
danjulio 0:e69d086cb053 57 RHModeSleep, ///< Transport hardware is in low power sleep mode (if supported)
danjulio 0:e69d086cb053 58 RHModeIdle, ///< Transport is idle.
danjulio 0:e69d086cb053 59 RHModeTx, ///< Transport is in the process of transmitting a message.
danjulio 0:e69d086cb053 60 RHModeRx, ///< Transport is in the process of receiving a message.
danjulio 0:e69d086cb053 61 RHModeCad ///< Transport is in the process of detecting channel activity (if supported)
danjulio 0:e69d086cb053 62 } RHMode;
danjulio 0:e69d086cb053 63
danjulio 0:e69d086cb053 64 /// Constructor
danjulio 0:e69d086cb053 65 RHGenericDriver();
danjulio 0:e69d086cb053 66
danjulio 0:e69d086cb053 67 /// Initialise the Driver transport hardware and software.
danjulio 0:e69d086cb053 68 /// Make sure the Driver is properly configured before calling init().
danjulio 0:e69d086cb053 69 /// \return true if initialisation succeeded.
danjulio 0:e69d086cb053 70 virtual bool init();
danjulio 0:e69d086cb053 71
danjulio 0:e69d086cb053 72 /// Tests whether a new message is available
danjulio 0:e69d086cb053 73 /// from the Driver.
danjulio 0:e69d086cb053 74 /// On most drivers, if there is an uncollected received message, and there is no message
danjulio 0:e69d086cb053 75 /// currently bing transmitted, this will also put the Driver into RHModeRx mode until
danjulio 0:e69d086cb053 76 /// a message is actually received by the transport, when it will be returned to RHModeIdle.
danjulio 0:e69d086cb053 77 /// This can be called multiple times in a timeout loop.
danjulio 0:e69d086cb053 78 /// \return true if a new, complete, error-free uncollected message is available to be retreived by recv().
danjulio 0:e69d086cb053 79 virtual bool available() = 0;
danjulio 0:e69d086cb053 80
danjulio 0:e69d086cb053 81 /// Turns the receiver on if it not already on.
danjulio 0:e69d086cb053 82 /// If there is a valid message available, copy it to buf and return true
danjulio 0:e69d086cb053 83 /// else return false.
danjulio 0:e69d086cb053 84 /// If a message is copied, *len is set to the length (Caution, 0 length messages are permitted).
danjulio 0:e69d086cb053 85 /// You should be sure to call this function frequently enough to not miss any messages
danjulio 0:e69d086cb053 86 /// It is recommended that you call it in your main loop.
danjulio 0:e69d086cb053 87 /// \param[in] buf Location to copy the received message
danjulio 0:e69d086cb053 88 /// \param[in,out] len Pointer to available space in buf. Set to the actual number of octets copied.
danjulio 0:e69d086cb053 89 /// \return true if a valid message was copied to buf
danjulio 0:e69d086cb053 90 virtual bool recv(uint8_t* buf, uint8_t* len) = 0;
danjulio 0:e69d086cb053 91
danjulio 0:e69d086cb053 92 /// Waits until any previous transmit packet is finished being transmitted with waitPacketSent().
danjulio 0:e69d086cb053 93 /// Then optionally waits for Channel Activity Detection (CAD)
danjulio 0:e69d086cb053 94 /// to show the channnel is clear (if the radio supports CAD) by calling waitCAD().
danjulio 0:e69d086cb053 95 /// Then loads a message into the transmitter and starts the transmitter. Note that a message length
danjulio 0:e69d086cb053 96 /// of 0 is NOT permitted. If the message is too long for the underlying radio technology, send() will
danjulio 0:e69d086cb053 97 /// return false and will not send the message.
danjulio 0:e69d086cb053 98 /// \param[in] data Array of data to be sent
danjulio 0:e69d086cb053 99 /// \param[in] len Number of bytes of data to send (> 0)
danjulio 0:e69d086cb053 100 /// specify the maximum time in ms to wait. If 0 (the default) do not wait for CAD before transmitting.
danjulio 0:e69d086cb053 101 /// \return true if the message length was valid and it was correctly queued for transmit. Return false
danjulio 0:e69d086cb053 102 /// if CAD was requested and the CAD timeout timed out before clear channel was detected.
danjulio 0:e69d086cb053 103 virtual bool send(const uint8_t* data, uint8_t len) = 0;
danjulio 0:e69d086cb053 104
danjulio 0:e69d086cb053 105 /// Returns the maximum message length
danjulio 0:e69d086cb053 106 /// available in this Driver.
danjulio 0:e69d086cb053 107 /// \return The maximum legal message length
danjulio 0:e69d086cb053 108 virtual uint8_t maxMessageLength() = 0;
danjulio 0:e69d086cb053 109
danjulio 0:e69d086cb053 110 /// Starts the receiver and blocks until a valid received
danjulio 0:e69d086cb053 111 /// message is available.
danjulio 0:e69d086cb053 112 virtual void waitAvailable();
danjulio 0:e69d086cb053 113
danjulio 0:e69d086cb053 114 /// Blocks until the transmitter
danjulio 0:e69d086cb053 115 /// is no longer transmitting.
danjulio 0:e69d086cb053 116 virtual bool waitPacketSent();
danjulio 0:e69d086cb053 117
danjulio 0:e69d086cb053 118 /// Blocks until the transmitter is no longer transmitting.
danjulio 0:e69d086cb053 119 /// or until the timeout occuers, whichever happens first
danjulio 0:e69d086cb053 120 /// \param[in] timeout Maximum time to wait in milliseconds.
danjulio 0:e69d086cb053 121 /// \return true if the radio completed transmission within the timeout period. False if it timed out.
danjulio 0:e69d086cb053 122 virtual bool waitPacketSent(uint16_t timeout);
danjulio 0:e69d086cb053 123
danjulio 0:e69d086cb053 124 /// Starts the receiver and blocks until a received message is available or a timeout
danjulio 0:e69d086cb053 125 /// \param[in] timeout Maximum time to wait in milliseconds.
danjulio 0:e69d086cb053 126 /// \return true if a message is available
danjulio 0:e69d086cb053 127 virtual bool waitAvailableTimeout(uint16_t timeout);
danjulio 0:e69d086cb053 128
danjulio 0:e69d086cb053 129 // Bent G Christensen (bentor@gmail.com), 08/15/2016
danjulio 0:e69d086cb053 130 /// Channel Activity Detection (CAD).
danjulio 0:e69d086cb053 131 /// Blocks until channel activity is finished or CAD timeout occurs.
danjulio 0:e69d086cb053 132 /// Uses the radio's CAD function (if supported) to detect channel activity.
danjulio 0:e69d086cb053 133 /// Implements random delays of 100 to 1000ms while activity is detected and until timeout.
danjulio 0:e69d086cb053 134 /// Caution: the random() function is not seeded. If you want non-deterministic behaviour, consider
danjulio 0:e69d086cb053 135 /// using something like randomSeed(analogRead(A0)); in your sketch.
danjulio 0:e69d086cb053 136 /// Permits the implementation of listen-before-talk mechanism (Collision Avoidance).
danjulio 0:e69d086cb053 137 /// Calls the isChannelActive() member function for the radio (if supported)
danjulio 0:e69d086cb053 138 /// to determine if the channel is active. If the radio does not support isChannelActive(),
danjulio 0:e69d086cb053 139 /// always returns true immediately
danjulio 0:e69d086cb053 140 /// \return true if the radio-specific CAD (as returned by isChannelActive())
danjulio 0:e69d086cb053 141 /// shows the channel is clear within the timeout period (or the timeout period is 0), else returns false.
danjulio 0:e69d086cb053 142 virtual bool waitCAD();
danjulio 0:e69d086cb053 143
danjulio 0:e69d086cb053 144 /// Sets the Channel Activity Detection timeout in milliseconds to be used by waitCAD().
danjulio 0:e69d086cb053 145 /// The default is 0, which means do not wait for CAD detection.
danjulio 0:e69d086cb053 146 /// CAD detection depends on support for isChannelActive() by your particular radio.
danjulio 0:e69d086cb053 147 void setCADTimeout(unsigned long cad_timeout);
danjulio 0:e69d086cb053 148
danjulio 0:e69d086cb053 149 /// Determine if the currently selected radio channel is active.
danjulio 0:e69d086cb053 150 /// This is expected to be subclassed by specific radios to implement their Channel Activity Detection
danjulio 0:e69d086cb053 151 /// if supported. If the radio does not support CAD, returns true immediately. If a RadioHead radio
danjulio 0:e69d086cb053 152 /// supports isChannelActive() it will be documented in the radio specific documentation.
danjulio 0:e69d086cb053 153 /// This is called automatically by waitCAD().
danjulio 0:e69d086cb053 154 /// \return true if the radio-specific CAD (as returned by override of isChannelActive()) shows the
danjulio 0:e69d086cb053 155 /// current radio channel as active, else false. If there is no radio-specific CAD, returns false.
danjulio 0:e69d086cb053 156 virtual bool isChannelActive();
danjulio 0:e69d086cb053 157
danjulio 0:e69d086cb053 158 /// Sets the address of this node. Defaults to 0xFF. Subclasses or the user may want to change this.
danjulio 0:e69d086cb053 159 /// This will be used to test the adddress in incoming messages. In non-promiscuous mode,
danjulio 0:e69d086cb053 160 /// only messages with a TO header the same as thisAddress or the broadcast addess (0xFF) will be accepted.
danjulio 0:e69d086cb053 161 /// In promiscuous mode, all messages will be accepted regardless of the TO header.
danjulio 0:e69d086cb053 162 /// In a conventional multinode system, all nodes will have a unique address
danjulio 0:e69d086cb053 163 /// (which you could store in EEPROM).
danjulio 0:e69d086cb053 164 /// You would normally set the header FROM address to be the same as thisAddress (though you dont have to,
danjulio 0:e69d086cb053 165 /// allowing the possibilty of address spoofing).
danjulio 0:e69d086cb053 166 /// \param[in] thisAddress The address of this node.
danjulio 0:e69d086cb053 167 virtual void setThisAddress(uint8_t thisAddress);
danjulio 0:e69d086cb053 168
danjulio 0:e69d086cb053 169 /// Sets the TO header to be sent in all subsequent messages
danjulio 0:e69d086cb053 170 /// \param[in] to The new TO header value
danjulio 0:e69d086cb053 171 virtual void setHeaderTo(uint8_t to);
danjulio 0:e69d086cb053 172
danjulio 0:e69d086cb053 173 /// Sets the FROM header to be sent in all subsequent messages
danjulio 0:e69d086cb053 174 /// \param[in] from The new FROM header value
danjulio 0:e69d086cb053 175 virtual void setHeaderFrom(uint8_t from);
danjulio 0:e69d086cb053 176
danjulio 0:e69d086cb053 177 /// Sets the ID header to be sent in all subsequent messages
danjulio 0:e69d086cb053 178 /// \param[in] id The new ID header value
danjulio 0:e69d086cb053 179 virtual void setHeaderId(uint8_t id);
danjulio 0:e69d086cb053 180
danjulio 0:e69d086cb053 181 /// Sets and clears bits in the FLAGS header to be sent in all subsequent messages
danjulio 0:e69d086cb053 182 /// First it clears he FLAGS according to the clear argument, then sets the flags according to the
danjulio 0:e69d086cb053 183 /// set argument. The default for clear always clears the application specific flags.
danjulio 0:e69d086cb053 184 /// \param[in] set bitmask of bits to be set. Flags are cleared with the clear mask before being set.
danjulio 0:e69d086cb053 185 /// \param[in] clear bitmask of flags to clear. Defaults to RH_FLAGS_APPLICATION_SPECIFIC
danjulio 0:e69d086cb053 186 /// which clears the application specific flags, resulting in new application specific flags
danjulio 0:e69d086cb053 187 /// identical to the set.
danjulio 0:e69d086cb053 188 virtual void setHeaderFlags(uint8_t set, uint8_t clear = RH_FLAGS_APPLICATION_SPECIFIC);
danjulio 0:e69d086cb053 189
danjulio 0:e69d086cb053 190 /// Tells the receiver to accept messages with any TO address, not just messages
danjulio 0:e69d086cb053 191 /// addressed to thisAddress or the broadcast address
danjulio 0:e69d086cb053 192 /// \param[in] promiscuous true if you wish to receive messages with any TO address
danjulio 0:e69d086cb053 193 virtual void setPromiscuous(bool promiscuous);
danjulio 0:e69d086cb053 194
danjulio 0:e69d086cb053 195 /// Returns the TO header of the last received message
danjulio 0:e69d086cb053 196 /// \return The TO header
danjulio 0:e69d086cb053 197 virtual uint8_t headerTo();
danjulio 0:e69d086cb053 198
danjulio 0:e69d086cb053 199 /// Returns the FROM header of the last received message
danjulio 0:e69d086cb053 200 /// \return The FROM header
danjulio 0:e69d086cb053 201 virtual uint8_t headerFrom();
danjulio 0:e69d086cb053 202
danjulio 0:e69d086cb053 203 /// Returns the ID header of the last received message
danjulio 0:e69d086cb053 204 /// \return The ID header
danjulio 0:e69d086cb053 205 virtual uint8_t headerId();
danjulio 0:e69d086cb053 206
danjulio 0:e69d086cb053 207 /// Returns the FLAGS header of the last received message
danjulio 0:e69d086cb053 208 /// \return The FLAGS header
danjulio 0:e69d086cb053 209 virtual uint8_t headerFlags();
danjulio 0:e69d086cb053 210
danjulio 0:e69d086cb053 211 /// Returns the most recent RSSI (Receiver Signal Strength Indicator).
danjulio 0:e69d086cb053 212 /// Usually it is the RSSI of the last received message, which is measured when the preamble is received.
danjulio 0:e69d086cb053 213 /// If you called readRssi() more recently, it will return that more recent value.
danjulio 0:e69d086cb053 214 /// \return The most recent RSSI measurement in dBm.
danjulio 0:e69d086cb053 215 int8_t lastRssi();
danjulio 0:e69d086cb053 216
danjulio 0:e69d086cb053 217 /// Returns the operating mode of the library.
danjulio 0:e69d086cb053 218 /// \return the current mode, one of RF69_MODE_*
danjulio 0:e69d086cb053 219 RHMode mode();
danjulio 0:e69d086cb053 220
danjulio 0:e69d086cb053 221 /// Sets the operating mode of the transport.
danjulio 0:e69d086cb053 222 void setMode(RHMode mode);
danjulio 0:e69d086cb053 223
danjulio 0:e69d086cb053 224 /// Sets the transport hardware into low-power sleep mode
danjulio 0:e69d086cb053 225 /// (if supported). May be overridden by specific drivers to initialte sleep mode.
danjulio 0:e69d086cb053 226 /// If successful, the transport will stay in sleep mode until woken by
danjulio 0:e69d086cb053 227 /// changing mode it idle, transmit or receive (eg by calling send(), recv(), available() etc)
danjulio 0:e69d086cb053 228 /// \return true if sleep mode is supported by transport hardware and the RadioHead driver, and if sleep mode
danjulio 0:e69d086cb053 229 /// was successfully entered. If sleep mode is not suported, return false.
danjulio 0:e69d086cb053 230 virtual bool sleep();
danjulio 0:e69d086cb053 231
danjulio 0:e69d086cb053 232 /// Prints a data buffer in HEX.
danjulio 0:e69d086cb053 233 /// For diagnostic use
danjulio 0:e69d086cb053 234 /// \param[in] prompt string to preface the print
danjulio 0:e69d086cb053 235 /// \param[in] buf Location of the buffer to print
danjulio 0:e69d086cb053 236 /// \param[in] len Length of the buffer in octets.
danjulio 0:e69d086cb053 237 static void printBuffer(const char* prompt, const uint8_t* buf, uint8_t len);
danjulio 0:e69d086cb053 238
danjulio 0:e69d086cb053 239 /// Returns the count of the number of bad received packets (ie packets with bad lengths, checksum etc)
danjulio 0:e69d086cb053 240 /// which were rejected and not delivered to the application.
danjulio 0:e69d086cb053 241 /// Caution: not all drivers can correctly report this count. Some underlying hardware only report
danjulio 0:e69d086cb053 242 /// good packets.
danjulio 0:e69d086cb053 243 /// \return The number of bad packets received.
danjulio 0:e69d086cb053 244 uint16_t rxBad();
danjulio 0:e69d086cb053 245
danjulio 0:e69d086cb053 246 /// Returns the count of the number of
danjulio 0:e69d086cb053 247 /// good received packets
danjulio 0:e69d086cb053 248 /// \return The number of good packets received.
danjulio 0:e69d086cb053 249 uint16_t rxGood();
danjulio 0:e69d086cb053 250
danjulio 0:e69d086cb053 251 /// Returns the count of the number of
danjulio 0:e69d086cb053 252 /// packets successfully transmitted (though not necessarily received by the destination)
danjulio 0:e69d086cb053 253 /// \return The number of packets successfully transmitted
danjulio 0:e69d086cb053 254 uint16_t txGood();
danjulio 0:e69d086cb053 255
danjulio 0:e69d086cb053 256 protected:
danjulio 0:e69d086cb053 257
danjulio 0:e69d086cb053 258 /// The current transport operating mode
danjulio 0:e69d086cb053 259 volatile RHMode _mode;
danjulio 0:e69d086cb053 260
danjulio 0:e69d086cb053 261 /// This node id
danjulio 0:e69d086cb053 262 uint8_t _thisAddress;
danjulio 0:e69d086cb053 263
danjulio 0:e69d086cb053 264 /// Whether the transport is in promiscuous mode
danjulio 0:e69d086cb053 265 bool _promiscuous;
danjulio 0:e69d086cb053 266
danjulio 0:e69d086cb053 267 /// TO header in the last received mesasge
danjulio 0:e69d086cb053 268 volatile uint8_t _rxHeaderTo;
danjulio 0:e69d086cb053 269
danjulio 0:e69d086cb053 270 /// FROM header in the last received mesasge
danjulio 0:e69d086cb053 271 volatile uint8_t _rxHeaderFrom;
danjulio 0:e69d086cb053 272
danjulio 0:e69d086cb053 273 /// ID header in the last received mesasge
danjulio 0:e69d086cb053 274 volatile uint8_t _rxHeaderId;
danjulio 0:e69d086cb053 275
danjulio 0:e69d086cb053 276 /// FLAGS header in the last received mesasge
danjulio 0:e69d086cb053 277 volatile uint8_t _rxHeaderFlags;
danjulio 0:e69d086cb053 278
danjulio 0:e69d086cb053 279 /// TO header to send in all messages
danjulio 0:e69d086cb053 280 uint8_t _txHeaderTo;
danjulio 0:e69d086cb053 281
danjulio 0:e69d086cb053 282 /// FROM header to send in all messages
danjulio 0:e69d086cb053 283 uint8_t _txHeaderFrom;
danjulio 0:e69d086cb053 284
danjulio 0:e69d086cb053 285 /// ID header to send in all messages
danjulio 0:e69d086cb053 286 uint8_t _txHeaderId;
danjulio 0:e69d086cb053 287
danjulio 0:e69d086cb053 288 /// FLAGS header to send in all messages
danjulio 0:e69d086cb053 289 uint8_t _txHeaderFlags;
danjulio 0:e69d086cb053 290
danjulio 0:e69d086cb053 291 /// The value of the last received RSSI value, in some transport specific units
danjulio 0:e69d086cb053 292 volatile int8_t _lastRssi;
danjulio 0:e69d086cb053 293
danjulio 0:e69d086cb053 294 /// Count of the number of bad messages (eg bad checksum etc) received
danjulio 0:e69d086cb053 295 volatile uint16_t _rxBad;
danjulio 0:e69d086cb053 296
danjulio 0:e69d086cb053 297 /// Count of the number of successfully transmitted messaged
danjulio 0:e69d086cb053 298 volatile uint16_t _rxGood;
danjulio 0:e69d086cb053 299
danjulio 0:e69d086cb053 300 /// Count of the number of bad messages (correct checksum etc) received
danjulio 0:e69d086cb053 301 volatile uint16_t _txGood;
danjulio 0:e69d086cb053 302
danjulio 0:e69d086cb053 303 /// Channel activity detected
danjulio 0:e69d086cb053 304 volatile bool _cad;
danjulio 0:e69d086cb053 305
danjulio 0:e69d086cb053 306 /// Channel activity timeout in ms
danjulio 0:e69d086cb053 307 unsigned int _cad_timeout;
danjulio 0:e69d086cb053 308
danjulio 0:e69d086cb053 309 private:
danjulio 0:e69d086cb053 310
danjulio 0:e69d086cb053 311 Timer _waitTimer;
danjulio 0:e69d086cb053 312
danjulio 0:e69d086cb053 313 };
danjulio 0:e69d086cb053 314
danjulio 0:e69d086cb053 315
danjulio 0:e69d086cb053 316 #endif