tcpTest continued
This commit is contained in:
parent
90cabf613b
commit
61551556b4
@ -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) {
|
||||||
@ -64,6 +66,13 @@ void tcpTestHandler(void *handle) {
|
|||||||
}
|
}
|
||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user