Both uarts at once?


#1

Trying to use both uarts on the Q2406.
Set uart2 open using AT+WMFM.

First subscribe to V24 on Uart1.
When I subscribe to V24 on Uart2 I get already subscribed response.
Any ideas?

case 7:

// subscribe to FCM for serial port
fcm_handle = adl_fcmSubscribe (ADL_FCM_FLOW_V24_UART1, FcmCtrlHandler, FcmDataHandler);
// select next state.
SimTimState = 8;
// start timer for move to next state
simTimer = adl_tmrSubscribe (FALSE,20,ADL_TMR_TYPE_100MS,simHandler);

break;

case 8:

// set sp1 to data mode
adl_fcmSwitchV24State (fcm_handle, ADL_FCM_V24_STATE_DATA);
// select next state.
SimTimState = 9;
// start timer for move to next state
simTimer = adl_tmrSubscribe (FALSE,20,ADL_TMR_TYPE_100MS,simHandler);

break;

case 9:

// debug
wm_sprintf ( Buff, "\r\nsubscribe UART1: %d \r\n", fcm_handle);
adl_fcmSendData (fcm_handle, Buff, wm_strlen(Buff));

// subscribe to FCM for serial port 2
fcm_handle2 = adl_fcmSubscribe (ADL_FCM_FLOW_V24_UART2, FcmCtrlHandler2, FcmDataHandler2);
// select next state.
SimTimState = 10;
// start timer for move to next state
simTimer = adl_tmrSubscribe (FALSE,20,ADL_TMR_TYPE_100MS,simHandler);

break;

case 10:

// set sp2 to data mode
adl_fcmSwitchV24State (fcm_handle2, ADL_FCM_V24_STATE_DATA);
// select next state.
SimTimState = 11;
// start timer for move to next state
simTimer = adl_tmrSubscribe (FALSE,20,ADL_TMR_TYPE_100MS,simHandler);

break;

#2

With a bit of help from a friend I have sorted it.
You have to subscribe to both uarts first then set them to data mode after.
Also don’t output any debug (using the uarts) until you have done these steps.
Works now.