fer.caballero thanks i will read about strings in C, but when i try my application in Terminal Emulator, when i write anything in window of Data: from Serial Link Manager displayed, from External COM displayed, what i wrote appears in data.txt on my server, for this is that i think a my app is read good from station, but she not sending nothing i think…
Where i can read the syntax of this function? In API documentation I did not find…
First time you work with OpenAT adl is difficult to find the description of handling functions, because in the documentation you have this description after a prototipe not a function name (f.ex.: typedef void (*function_type) (u8 parameter1, u16 *parameter2)). Take a look just after adl_fcmSubscribe.
Anyway, did you understand why it’s need to include a \0? Maybe we are getting lost in translation. sprintf, strcat, strcpy… and similar functions need to work that \0. You give them a pointer to the start of the string, and they know where is the end searching for that \0. So your sprintf would copy nothing or rubish, and the same about your strcat.
That function is called whenever data is received on the subscribed Flow;
The ‘DataLen’ parameter tells you how many bytes of data were received;
The ‘Data’ parameter points to a buffer containing the received bytes
Note that FCM might collect a number of bytes and deliver them all togethger in a single call to the Data handler, or it might deliver them one-by-one in multiple calls - see the ADL User Guide for details.
Therefore your application must cope with a single “message” from the external device possibly being delivered in several separate calls to the Data Handler…
Can I suggest that you use the (Open Source) application RealTerm to work out exactly what is being sent back and forwards between the PC and your device. Hyperterm (while useful as it comes with windows) is not the worlds best terminal emulator for doing the sort of stuff you are trying to do.
Realterm lets you display inbound and outbound data in a number of different ways - ASCII, HEX bytes, HEX chars - or a number of combinations of these.
This will at least work out what characters your device is sending (including command terminations).