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 );
72 void getMessage( TOSMessage& message );
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:687
TinyOS generic message.
Definition: MoteProtocol.h:202
void open(const char *tty="/dev/ttyUSB0", SerialStreamBuf::BaudRateEnum baud_rate=SerialStreamBuf::BAUD_115200)
Configures and opens the serial port connection.
Definition: MoteIF.cpp:62
void sendMessage(TOSMessage &message, uint8_t type=0)
Encapsulates a TinyOS message in a packet and sends it to the mote.
Definition: MoteIF.h:117
void setOS(int v)
Set TinyOS version.
Definition: MoteProtocol.cpp:680
Implements the basic sending and receiving capabilities on iostreams.
Definition: MoteProtocol.h:144