Datasheet
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com
UARTWrite(1, "RTCC Alarm!\r\n");
}
// Check for UART commands
if(UARTBufferSize(1) > 0)
{
vTaskDelay(50);
char uread[257];
int toread = UARTBufferSize(1);
if(toread > 255)
toread = 255;
UARTRead(1, uread, toread);
uread[toread] = '\0';
// Command parsing
if(strstr(uread, "off")!=NULL)
{
UARTWrite(1, "Wi-Fi OFF (WFHibernate)\r\n");
WFHibernate();
}
else if(strstr(uread, "sleep")!=NULL)
{
UARTWrite(1, "entering in sleep mode (WFSleep)...\r\n");
WFSleep();
}
else if(strstr(uread, "on")!=NULL)
{
UARTWrite(1, "Wi-Fi activation (WFOn)\r\n");
WFOn();
}
else if(strstr(uread, "up")!=NULL)
{
UARTWrite(1, "Connecting defaults...\r\n");
WFConnect(WF_DEFAULT);
UARTWrite(1, "connection launched\r\n");
}
else if(strstr(uread, "dn")!=NULL)
{
UARTWrite(1, "Disconnecting from network...\r\n");
WFDisconnect();
}
else if(strstr(uread, "rtcc")!=NULL)
{
// Print RTCC
RTCCGet(&mytime);
UARTWrite(1, "RTCC state: ");
sprintf(rtccString, "%d:%d.%d\r\n",
mytime.tm_hour,mytime.tm_min, mytime.tm_sec);
UARTWrite(1, rtccString);
}
}
}
}
73










