Send and receive teonet messages
Test application to send and receive teonet messages.
How to execute this test:
1) Start one teonet test application in terminal:
tests/teosend teosend -p 9500
2) Start another test application in other terminal:
tests/teosend teorecv -r 9500 -a 127.0.0.1
- subscribe to timer event
- send message by timer
- show received messages
- show idle event
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TSEND_VERSION VERSION
size_t data_len, void *user_data) {
switch(event) {
printf("Event: Event manager started\n");
break;
break;
break;
{
printf("Event: Data received %d bytes\n", (int)data_len);
printf(
"Command: %d, Data: %s, got from: %s\n", rd->
cmd, (
char*)rd->
data, rd->
from);
}
break;
printf("Event: Idle time\n");
break;
{
const char *teorecv = "teorecv";
}
}
break;
default:
break;
}
}
int main(
int argc,
char** argv) {
return (EXIT_SUCCESS);
}