Hi everyone,
I’m in big trouble with the rate selection of the UART2 from the code…
I have read the post about but it still not work…
sReturn = adl_atCmdCreate("AT+WMFM=0,0,2", FALSE, uart_WMFMRspHandler_Stop,"*",NULL);
Log(LOG_LEVEL_WARNING,"uart_Configure : adl_atCmdCreate : AT+WMFM=0,0,2 : %d", sReturn);
/* I have sometimes +CMR ERROR : 3 (Operation not allowed. This error is returned when a
wrong parameter is detected.)
The problem is that I don't see what'sn wrong.... */
I wait the OK before doing the code here after :
// Execute the command AT+IPR=9600 to set the baud rate to 9600 baud/s
sReturn = adl_atCmdCreate("AT+IPR=9600", ADL_AT_PORT_TYPE( ADL_AT_UART2, FALSE ), uart_IPRRspHandler_Set,"*",NULL);
Log(LOG_LEVEL_WARNING,"uart_WMFMRspHandler_Stop : adl_atCmdCreate : AT+IPR=9600 : %d", sReturn);
sReturn = adl_atCmdCreate("AT+ICF=3,4", ADL_AT_PORT_TYPE( ADL_AT_UART2, FALSE ), uart_ICFRspHandler,"*",NULL);
Log(LOG_LEVEL_WARNING,"uart_IPRRspHandler_Set : adl_atCmdCreate : AT+ICF=3,4 : %d", sReturn);
// Save the current configuration in flash
sReturn = adl_atCmdCreate("AT&W", ADL_AT_PORT_TYPE( ADL_AT_UART2, FALSE ), uart_ATWRspHandler,"*",NULL);
Log(LOG_LEVEL_WARNING,"uart_ICFRspHandler : adl_atCmdCreate : AT&W : %d", sReturn);
// Execute the command AT+WMFM=1 to enable uart 2
sReturn = adl_atCmdCreate("AT+WMFM=0,1,2", FALSE, uart_WMFMRspHandler_Start,"*",NULL);
Log(LOG_LEVEL_WARNING,"uart_ICFRspHandler : adl_atCmdCreate : AT+WMFM=0,1,2 : %d", sReturn);
Sometimes it works sometimes not…
I’m using OpenAT 4 with a Q2686H.
Thanks
Greatings
gdt
since the port was already closed - but if you would like to be absolutely sure you could as a very first step inquire the state of the port. Then you know if it is closed and you will only send the close command if the port is open… Then you should not get an error, or something else is really wrong…