1 #ifndef _SERIALCONTROL_H_
2 #define _SERIALCONTROL_H_
5 #include "motecontrol/localconstants.h"
6 #include "Configuration.h"
14 #include <sys/signal.h>
15 #include <sys/types.h>
17 #include <sys/ioctl.h>
19 namespace remote
{ namespace diku_mch
{
21 using namespace protocols
;
22 using namespace protocols::motecontrol
;
27 SerialControl(unsigned int portnumber
);
28 const std::string
& getDeviceName();
31 pid_t
program(uint64_t macAddress
, uint16_t tosAddress
,std::string program
);
32 bool getProgrammingResult(result_t
& result
);
33 result_t
cancelProgramming();
37 int readBuf(char* buf
, int len
);
38 int writeBuf(const char* buf
, int len
);
40 void writeChar(char c
);
44 void cleanUpProgram();
48 bool isRunning
, isOpen
, isProgramming
,wasProgramming
;
50 std::string DeviceName
;
51 std::string flashFile
;
52 struct termios newsertio
, oldsertio
;