demo works ...
This commit is contained in:
+1
-1
@@ -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
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user