32 #include <SerialStream.h>
36 #include "MoteProtocol.h"
40 using namespace LibSerial;
69 void open(
const char *tty =
"/dev/ttyUSB0", SerialStreamBuf::BaudRateEnum baud_rate = SerialStreamBuf::BAUD_115200 );
73 void sendMessage(
TOSMessage& message, uint8_t type = 0 );
75 bool setTiming(
short vmin,
short vtime );
89 inline void MoteIF::getMessage(
TOSMessage& message ) {
91 protocol.getMessage( message );
103 type = P_TOS1_PACKET_NO_ACK;
105 type = P_TOS2_PACKET_NO_ACK;
108 type = P_TOS1_PACKET_ACK;
110 type = P_TOS2_PACKET_ACK;
113 protocol.sendMessage( message, type );
int getOS()
Get current TinyOS version.
Definition: MoteProtocol.cpp:669
TinyOS generic message.
Definition: MoteProtocol.h:205
void open(const char *tty="/dev/ttyUSB0", SerialStreamBuf::BaudRateEnum baud_rate=SerialStreamBuf::BAUD_115200)
Configures and opens the serial port connection.
Definition: MoteIF.cpp:44
This class provides serial-port-ready access to the mote.
Definition: MoteIF.h:64
void sendMessage(TOSMessage &message, uint8_t type=0)
Encapsulates a TinyOS message in a packet and sends it to the mote.
Definition: MoteIF.h:99
void setOS(int v)
Set TinyOS version.
Definition: MoteProtocol.cpp:662
Implements the basic sending and receiving capabilities on iostreams.
Definition: MoteProtocol.h:147