Skip to content

Instantly share code, notes, and snippets.

@zarya
Created September 28, 2014 16:04
Show Gist options
  • Save zarya/637ca0a1853e68523b86 to your computer and use it in GitHub Desktop.
Save zarya/637ca0a1853e68523b86 to your computer and use it in GitHub Desktop.
void ICACHE_FLASH_ATTR
at_tcpclient_recv(void *arg, char *pdata, unsigned short len)
{
struct espconn *pespconn = (struct espconn *)arg;
at_linkConType *linkTemp = (at_linkConType *)pespconn->reverse;
char temp[32];
if(at_ipMux)
{
os_sprintf(temp, "\r\n+IPD,%d,%d:",
linkTemp->linkId, len);
uart0_sendStr(temp);
uart0_tx_buffer(pdata, len);
if (pdata[0] == 'L' && pdata[1] == 'E' && pdata[2] == 'D') {
if (pdata[3] == '1') {
uart0_sendStr("\r\nSet led ON\r\n");
gpio_output_set(BIT2, 0, BIT2, 0);
//gpio_output_set(GPIO_ID_PIN(2), 1);
} else {
uart0_sendStr("\r\nSet led OFF\r\n");
gpio_output_set(0, BIT2, BIT2, 0);
//gpio_output_set(GPIO_ID_PIN(2), 0);
}
}
}
else if(IPMODE == FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment