Using serial RAW data


#1

Hi All,

Is it possible to have RAW data received on UART1/UART2 port of Wismo in my OpenAT application??

If so how and do I have to manage the Flow of data on UART like which UART port should I reply to ??

Dont mind if I have posted, already asked questions :wink:

Thanks for answers,
-Jiten.


#2

Hi Jiten,

First, you should make sure that the UART you would like to use is activated. This is done with the command AT+WMFM.

Assuming, you use ADL to write the application, you then need to subscribe for the Flow with for example

Handle = adl_fcmSubscribe( ADL_FCM_FLOW_V24_UART2, fcmCtrlH, fcmDataH );

and you add the following functions to your code:

bool fcmCtrlH( adl_fcmEvent_e event ) {...}
bool fcmDataH( u16 DataLen, u8 *Data ) {...}

Now, you can switch to Data Mode in the fcmCtrlH handler function when the flow is opened. In this case the handler function is called with event “ADL_FCM_EVENT_FLOW_OPENNED” and you would call “adl_fcmSwitchV24State(Handle, ADL_FCM_V24_STATE_DATA);” to switch… After mode has switched, your handler function will be called with event “ADL_FCM_EVENT_V24_DATA_MODE”.

You can now use the port in raw mode, using

adl_fcmSendData(Handle,buffer,length);

to send data. And in case you receive data, the fcmDataH handler function will be called with the data length and a pointer to the data.

Hopefully this helps…

Best Regards,
Jan


#3

Thanks Jan.

I wil try this :slight_smile:

-Jiten-


#4

Hi again,

I tried, as below:

  1. Send AT+WMFM? command and received this :
at+wmfm?

+WMFM: 0,2,0,1
+WMFM: 0,2,1,0
+WMFM: 1,2,4,0
+WMFM: 1,2,4,1

I use default only UART 1 and response seems Ok .

2 Created a application and subcribed to flow control:

fcmHandle = adl_fcmSubscribe( ADL_FCM_FLOW_V24_UART1, fcmCtrlH, fcmDataH );
  1. Upon receiving the “ADL_FCM_EVENT_FLOW_OPENNED” in handler; I Switch to data mode using
stateRsp = adl_fcmSwitchV24State(fcmHandle, ADL_FCM_V24_STATE_DATA);
  1. After this I receive the event “ADL_FCM_EVENT_V24_DATA_MODE” in handler meaning that my Wismo is in DATA mode.

BUT… the wismo yet replies to AT command and it seems that it has not switched to DATA mode !

Did I go some where wrong or some configuration yet left ??
I use Wismo 2501B Type wismos.

Thanks for help.

-Jiten.


#5

Hi Jiten,

it looks OK to me…

Are you sending any AT commands with adl_atCmdCreate(), using the ADL_AT_PORT_TYPE macro to select UART1 after you have switched the mode to data? I noticed when I did that on UART2 that the mode was switched back to data mode…

Best Regards,
Jan


#6

Hi Jan,

No I am sending AT commands using the serial port.

I just took the HelloWorld Example and modified for raw data transmission. But doesnt seem to work :frowning:

-Jiten.


#7

Hi Jiten9,
Are you using Terminal Emulator to send AT commands? In this case, your AT commands will execute even if you are in data mode. This is because, Terminal Emulator provides separate Windows for sending AT commands and Data. Terminal emulator also inserts special control characters to indicate whether the send data is an AT command or data. So, when an AT command is exeucted from Terminal Emulator, it would respond even if you are in data mode.

To solve the problem, please make sure that ADL_FCM_EVENT_DATA_MODE is received in the FCM control handler. Now type something in the data window of Terminal Emulator. You will receive the typed character in the FCM data handler.

Alternatively, you can execute the applicaiton in target mode and then use hyperterminal to execute the applicaiton. In this case, when your application switchtes the module’s V24 link to data mode, you will receive whatever you type in hyperterminal in your data handler.

I think this should solve your problem,
Regards,
Open AT Fan.


#8

Thanks a lot guys I finally managed it 8)

It was the problem in Terminal Emulator software that replied to AT commands.

Just used Hyperterminal and it worked fine :slight_smile:

-Jiten