demo works ...

This commit is contained in:
2017-10-15 23:19:39 +02:00
parent 46883a9baa
commit 8415f15c99
4 changed files with 79 additions and 82 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ int main(void)
TF_SendSimple(1, (pu8)"Ahoj", 5);
TF_SendSimple(1, (pu8)"Hello", 6);
TF_QuerySimple(1, (pu8)"Query!", 6, testIdListener, 0);
TF_QuerySimple(2, (pu8)"Query!", 6, testIdListener, 0);
while(1) usleep(10);
}
+11 -1
View File
@@ -12,9 +12,18 @@ bool helloListener(TF_MSG *msg)
{
printf("helloListener()\n");
dumpFrameInfo(msg);
msg->data = (const uint8_t *) "jak se mas?";
return true;
}
bool replyListener(TF_MSG *msg)
{
printf("replyListener()\n");
dumpFrameInfo(msg);
msg->data = (const uint8_t *) "response to query";
msg->len = (TF_LEN) strlen((const char *) msg->data);
TF_Respond(msg);
TF_SendSimple(77, (const uint8_t *) "NAZDAR", 7);
return true;
}
@@ -22,6 +31,7 @@ int main(void)
{
TF_Init(TF_SLAVE);
TF_AddTypeListener(1, helloListener);
TF_AddTypeListener(2, replyListener);
demo_init(TF_SLAVE);
printf("MAIN PROCESS CONTINUES...\n");