diff --git a/firmware/wifiHD/src/ard_spi.c b/firmware/wifiHD/src/ard_spi.c index 054f1ea..728b056 100644 --- a/firmware/wifiHD/src/ard_spi.c +++ b/firmware/wifiHD/src/ard_spi.c @@ -1204,13 +1204,13 @@ cmd_spi_state_t avail_data_tcp_cmd_cb(char* recv, char* reply, void* ctx, uint16 CHECK_ARD_NETIF(recv, reply, count); CREATE_HEADER_REPLY(reply, recv, PARAM_NUMS_1); - uint8_t dataAvail = 0; + uint16_t dataAvail = 0; if ((recv[3]==1)&&(recv[4]>=0)&&(recv[4]>8); \ + BYTE[IDX+1] = (uint8_t)(_int & 0xff); \ +} + #define PUT_DATA_BYTE(DATA, BYTE, IDX) { \ BYTE[IDX] = 1; \ BYTE[IDX+1] = (uint8_t)DATA; \ @@ -235,9 +242,10 @@ #endif #define DUMP_TCP_STATE(TTCP) do {\ - INFO_TCP("ttcp:%p tpcb:%p state:%d lpcb:%p state:%d\n", \ + INFO_TCP("ttcp:%p tpcb:%p state:%d lpcb:%p state:%d left:%d sent:%d\n", \ TTCP, TTCP->tpcb[0], (TTCP->tpcb[0])?TTCP->tpcb[0]->state:0, \ - TTCP->lpcb, (TTCP->lpcb)?TTCP->lpcb->state:0); \ + TTCP->lpcb, (TTCP->lpcb)?TTCP->lpcb->state:0, \ + (TTCP)?TTCP->left:0, (TTCP)?TTCP->buff_sent:0); \ } while(0); #define Mode2Str(_Mode) ((_Mode==0)?"TRANSMIT":"RECEIVE") @@ -275,6 +283,8 @@ bool getTcpData(uint8_t sock, void** payload, uint16_t* len); bool getTcpDataByte(uint8_t sock, uint8_t* payload, uint8_t peek); +uint16_t getAvailTcpDataByte(uint8_t sock); + bool isAvailTcpDataByte(uint8_t sock); uint8_t freeTcpData(uint8_t sock);