tcpTest continued

This commit is contained in:
Wolfgang Hottgenroth 2020-11-11 15:01:03 +01:00
parent 90cabf613b
commit 61551556b4
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -20,7 +20,9 @@ uint16_t remotePort = 5000;
void tcpTestHandler(void *handle) { void tcpTestHandler(void *handle) {
static uint8_t state = 0; static uint8_t state = 0;
int8_t res = 0; int8_t res = 0;
int32_t res32 = 0;
static uint8_t message[] = "Hello world\n\r";
if (isNetworkAvailable()) { if (isNetworkAvailable()) {
switch (state) { switch (state) {
@ -63,7 +65,14 @@ void tcpTestHandler(void *handle) {
state = 255; state = 255;
} }
break; break;
case 3:
coloredMsg(LOG_YELLOW, "tth, now sending something");
int32_t res32 = send(TCPTEST_SOCK, message, strlen(message));
coloredMsg(LOG_YELLOW, "tth, sent a message, send returns 0x%02x", res32);
state = 255;
case 255: case 255:
coloredMsg(LOG_YELLOW, "tth, error state, will stop here"); coloredMsg(LOG_YELLOW, "tth, error state, will stop here");
schDel(tcpTestHandler, NULL); schDel(tcpTestHandler, NULL);