A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.

Dependents:   oldheating gps motorhome heating

Revision:
161:89609cf070b4
Parent:
156:be12b8fd5b21
Child:
162:fe50a1dcd043
--- a/tcp/tcb.c	Sun Sep 29 18:51:58 2019 +0000
+++ b/tcp/tcb.c	Wed Mar 11 08:29:28 2020 +0000
@@ -1,8 +1,10 @@
 #include <stdint.h>
 
-#include   "log.h"
-#include   "tcp.h"
-#include   "tcb.h"
+#include  "log.h"
+#include  "tcp.h"
+#include  "tcb.h"
+#include "http.h"
+#include "mstimer.h"
 
 #define TCB_COUNT 20
 
@@ -45,6 +47,21 @@
     else                         return tcbs;
     
 }
+void TcbSendAjax()
+{
+    for (int i = 0; i < TCB_COUNT; i++)
+    {
+        struct tcb* pTcb = tcbs + i;
+        if (pTcb->state)
+        {
+            HttpAddInt32AsHex(MsTimerCount - pTcb->timeLastRcvd); HttpAddChar('\t');
+            HttpAddInt16AsHex(pTcb->ipType);                      HttpAddChar('\t');
+            HttpAddInt32AsHex(pTcb->remArIndex);                  HttpAddChar('\t');
+            HttpAddInt16AsHex(pTcb->locPort);                     HttpAddChar('\n');
+        }
+    }
+}
+
 int TcbGetId(struct tcb* pTcb) //0 means none
 {
     return pTcb - tcbs + 1;