Send a message to another custom server.
Blueworx Voice Response library (libvae.a)
Custom Server library (libca.a)
#include "CA_header.h" int CA_Send_CA_Msg ( char *appl_name, char *function_name, size_t Nbytes, unsigned char *data );
This subroutine is used to send a message to another custom server specified by appl_name, via the function specified by function_name. A valid message must have a length in the range 0 to MAX_CA_MSG_DATA_LENGTH. The custom server for which the message is intended must be running.
The receiving user function should be defined to have two input parameters that correspond to the Nbytes and data parameters for CA_Send_CA_Msg(). In other words, the prototype for this function should be:
void function_name (long Nbytes, unsigned char *data);
where function_name is the name of the custom server user function.
Therefore given a WAITING custom server FVCN_CA_Send_CA with a System Generated main() having a user function:
void FVCN_recMsg ( long FVCN_recMsg_nbytes, char *FVCN_recMsg_recBuf) { printf("Receive bytes=%li buf=%s\n", FVCN_recMsg_nbytes, FVCN_recMsg_recBuf); }
which is defined with Input parameters:
long nbytes; char recBuf[12];
the call CA_Send_CA_Msg( "FVCN_CA_Send_CA", "FVCN_recMsg", 12, "Hello World"); from another custom server will generate the output:
Receive bytes=12 buf=Hello World
CA_ACCESS_NOBUFS
CA_INV_ADDR
CA_INV_FUNC_ID
CA_NOT_INIT
CA_NOT_STARTED
CA_PARM_OVERFLOW
CA_REQ_FAILED
CA_TERMINATING