Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DS1820 HighSpeedAnalogIn devices mbed
Diff: serialPC.cpp
- Revision:
- 4:13ff9c81dc10
- Parent:
- 2:55b7b466e742
- Child:
- 7:ae9c47f62946
--- a/serialPC.cpp Mon May 22 20:08:46 2017 +0000
+++ b/serialPC.cpp Fri Jun 02 13:31:56 2017 +0000
@@ -28,7 +28,9 @@
}
void serialPC::processaPacotePC(void const *args){
- char * bufIn;
+ char * bufIn;
+ char *ptr;
+ char *scanPtr;
uint16_t bufLength = bufPC.getLength();
bufIn = bufPC.get();
@@ -121,7 +123,20 @@
if(strstr(bufIn,"exibeArquivo:devices.cfg")!=NULL){
sdCard::exibeArquivo(&sdCard::devices);
return;
- }
+ }
+
+ ptr=strstr(bufIn,"*ServerCommand*");
+ if(ptr) {
+ //naoCompreendido=false;
+ scanPtr = strtok (ptr,"\\");
+ scanPtr = strtok (NULL,">");
+ strcpy(commands::buffer,scanPtr);
+ pc.printf("Comandos <%s>.\n",commands::buffer);
+ executaComandoServer = true;
+ //Se devo executar comando tenho que sair imediatamente.
+ return;
+ }
+
if(strstr(bufIn,"writeReadingsToSD()")){
eventosRTC::rotina15Minutos = true;
return;