Y SI / Mbed OS lib_Transmission_Serial_example

Dependencies:   lib_Transmission

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "main.h"
00002 
00003 int main(void)
00004 {
00005     while(1) ThisThread::sleep_for(200ms);
00006 }
00007 
00008 string transmission_processing(string cmd)
00009 {
00010     ostringstream ssend;
00011     ssend << fixed;
00012     ssend.precision(2);
00013     if(cmd.empty());
00014     else if(cmd == "*IDN?")
00015         ssend << MBED_PROJECT << ", Mbed OS " << MBED_VERSION << ", Version dated, " << __DATE__ << ", " << __TIME__;
00016     else if(cmd[cmd.size()-1] == '?')
00017         ssend << "incorrect requeste [" << cmd << "]";
00018     return ssend.str();
00019 }