Hi,
I have created UART.api containing a function :
FUNCTION UART_Response
(
string MessageOut[100] OUT
);
Then my server app contains the (empty) function:
void UART_UART_Response(char* MessageOut)
{
// code to change the MessageOut contents
}
And the client calls the server app:
char MessageOut[100] = "";
char* MessageOutPtr = &MessageOut[0];
UART_UART_Response(MessageOutPtr);
This call routine sets up an empty string array, and a pointer to the first array element. The client then uses the pointer to send the string’s address to the server for the server to edit the string and return back to the client.
When I compile using mkapp, it complains that there are too few arguments for ‘UART_UART_Response’
I can’t find documentation for IN and OUT for the .api file (other than http://legato.io/legato-docs/latest/apiFilesC.html#apiFilesC_event )
IN uses a string constant
I assume that OUT is to send data back to the client via a variable.
Please could someone clarify what IN and OUT do, and what I should do to pass data back to the client.
Thanks,
Andrew