diff --git a/sdk/lib/drivers/lwip/src/include/rosip.h b/sdk/lib/drivers/lwip/src/include/rosip.h index 2838da8a9ec..03aaf0c6a98 100644 --- a/sdk/lib/drivers/lwip/src/include/rosip.h +++ b/sdk/lib/drivers/lwip/src/include/rosip.h @@ -110,6 +110,7 @@ err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port); void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg); void LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set); +void LibTCPGetSocketStatus(PTCP_PCB pcb, PULONG State); /* IP functions */ void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size); diff --git a/sdk/lib/drivers/lwip/src/rostcp.c b/sdk/lib/drivers/lwip/src/rostcp.c index ea06d75a7f4..8e22ccd5c2d 100644 --- a/sdk/lib/drivers/lwip/src/rostcp.c +++ b/sdk/lib/drivers/lwip/src/rostcp.c @@ -840,3 +840,12 @@ LibTCPSetNoDelay( else pcb->flags &= ~TF_NODELAY; } + +void +LibTCPGetSocketStatus( + PTCP_PCB pcb, + PULONG State) +{ + /* Translate state from enum tcp_state -> MIB_TCP_STATE */ + *State = pcb->state + 1; +}