# wm_ioSerialSwitchState();

#1

Hi everybody

I am having a problem switching UART1 to data_mode.

``````wm_ioSerialSwitchState(WM_IO_UART1,WM_IO_SERIAL_DATA_MODE);

if (wm_fcmOpen(WM_FCM_V24_UART1,120) == 0)
{
wm_sprintf(texta,"\r\nSuccess\r");
wm_atSendUnsolicitedExternalApp ( ( u16 ) ( wm_strlen ( texta ) + 1 ), texta );
}
else {
wm_sprintf(textb,"\r\nFailure\r");
wm_atSendUnsolicitedExternalApp ( ( u16 ) ( wm_strlen ( textb ) + 1 ), textb );
}``````

The fcmopen(); succeeds. But the:

``````case WM_IO_SERIAL_SWITCH_STATE_RSP :
wm_sprintf(textc,"\r\nSwitched\r");
wm_atSendUnsolicitedExternalApp ( ( u16 ) ( wm_strlen ( textc ) + 1 ), textc );
break;``````

isn’t trrigered. Why isn’t it triggered?

Thanks, Stephan

#2

Hi Stephan,

I don’t know for sure since I am using ADL… Have you tried to open the flow first, and then switch the state? That’s what I doing in ADL, and that works fine…

Best Regards,
Jan

#3

Hi again,

Maybe the problem is that you are switching the UART on which you try to output to with wm_atSendUnsolicitedExternalApp(). Since it is now in data mode, maybe you should use the fcm functions instead to output data on the UART1 port?

Best Regards,
Jan