Y SI / Mbed OS lib_Transmission_Serial_example

Dependencies:   lib_Transmission

main.cpp

Committer:
YSI
Date:
2021-06-09
Revision:
10:0ab5c8865667
Parent:
9:89dc9f16aa06

File content as of revision 10:0ab5c8865667:

#include "main.h"

int main(void)
{
    while(1) ThisThread::sleep_for(200ms);
}

string transmission_processing(string cmd)
{
    ostringstream ssend;
    ssend << fixed;
    ssend.precision(2);
    if(cmd.empty());
    else if(cmd == "*IDN?")
        ssend << MBED_PROJECT << ", Mbed OS " << MBED_VERSION << ", Version dated, " << __DATE__ << ", " << __TIME__;
    else if(cmd[cmd.size()-1] == '?')
        ssend << "incorrect requeste [" << cmd << "]";
    return ssend.str();
}