I want to use FCM master data flow birectional. I want to be able to both send to and receive data from the wavecom module.
I subcribed required functions, no problem at this point. Then I tried a simple application in data mode in which modem will resend the data to the external application that comes from external application formerly. In short I wanted modem to behave as data mirror which reflects the received data to the external application. But it didn’t work. then I learned that modem was in ADL_FCM_WAY_FROM_EMBEDDED using adl_fcmGetStatus function!
What does this function do exactly? Is it possible to subcribe a to directional FCM data flow? At least how can I change the paramater ADL_FCM_WAY_FROM_EMBEDDED to ADL_FCM_WAY_TO_EMBEDDED?
Any reply will be appreciated.
The FCM flow which you subscribe can be used to echo the received data. There should not be any problem in doing this. Please verify that your Open-AT applicaiton is following the steps outlined below:
- Subscribe to FCM flow on the UART on which you want to echo the data.
- Switch the FCM flow to data mode (using adl_fcmSwitchV24State ()) when ADL_FCM_EVENT_FLOW_OPENNED event is recevied.
- Now, whatever data is typed in the data window of TE (or in hyperterminal window) will be received in the data handler (which you provided to adl_fcmSubscribe () API).
- To send the received data back to the external applicaiton, you can use adl_fcmSendData () API. Note that the handle parameter for this API should be the one that you provided while subscribing to FCM flow. The data parameter should be the pointer to the data which you want to send. Ensure that you have provided the correct pointer and the correct datalength parameter.
The API adl_fcmGetStatus () provides you with the status of FCM recieve and transmit buffer. Basically, when your applicaiton is receiving data from the external applicaiton, you can use ADL_FCM_WAY_TO_EMBEDDED parameter in this API to determine whether the receive buffer is full or empty. THis is indicated by the return value of this API (ADL_FCM_RET_BUFFER_EMPTY or ADL_FCM_RET_BUFFER_NOT_EMPTY).
If you want to find the status of transmit buffer, you should use ADL_FCM_WAY_FROM_EMBEDDED. This will indicate you whether your transmit buffer is empty or full (same as above).
As the FCM subscription controls the flow for which it is subscribed, it governs both the sending and receiving of data on that flow. It is up to you how you use the subscribed FCM flow (either as one directional or as bidirectional). The FCM flow provides you with both the functionalities of sending and receiving.
Hence, it suffices to say that you will be receiving data on the subscribed FCM flow whenever data arrives on that flow (assuming that the OAT application do not eat up all the receive credits). However, sending data on the flow will be determined by the usage of adl_fcmSendData () API which depends on the application logic.