-
Notifications
You must be signed in to change notification settings - Fork 5
AT Scripting GUI Control Macros (mcenter specific)
This document provides details about all the macros that can be used to control GUI features from AT scripting. e.g. open/close the serial port, start/stop tracing, etc.
bool MC_PORT_CONNECT();
This macro connects the AT com port.
RETURN VALUE
Return type: bool
true = successfully connected/already connected
false = failed
EXAMPLE
MC_PORT_CONNECT();
SUPPORTED BY
m-center v02.06.00 (and onward)
bool MC_PORT_DISCONNECT();
This macro disconnects the AT com port.
RETURN VALUE
Return type: bool
true = successfully disconnected/already disconnected
false = failed
EXAMPLE
MC_PORT_DISCONNECT();
SUPPORTED BY
m-center v02.06.00 (and onward)
bool SET_PORT_NAME(string in)
This macro sets the AT port name.
PARAMETERS
in: string
e.g. COM1, COM2, COM3 ...
RETURN VALUE
Return type: bool
true = if the requested feature is successful.
false = if the requested feature failed.
EXAMPLE
SET_PORT_NAME("COM1");
SUPPORTED BY
m-center v02.06.00 (and onward)
This macro sets the AT port baud rate.
true... if the requested feature successful
false... if the requested feature is failed
- int type 9600, 115200, 230400, 460800, 921600, 3M
SET_PORT_BAUD(115200);
This macro sets the AT port stop bits.
true... if the requested feature successful
false... if the requested feature is failed
- int type 1 or 2
SET_PORT_STOP_BITS(1);
This macro sets the AT port data bits E.g.,
true... if the requested feature successful
false... if the requested feature is failed
- int type 8 or 7 or 6 or 5
SET_PORT_DATA_BITS(8);
This macro sets the AT port flow control.
true... if the requested feature successful
false... if the requested feature is failed
- int type Input values(0:none, 1:hardware, 2:xon-xoff)
SET_PORT_FLOW_CONTROL(1);
This macro sets the AT port parity.
true... if the requested feature successful
false... if the requested feature is failed
- int type 0:none, 1:even, 2:odd
SET_PORT_PARITY(0);
bool MC_TRACE_START(string file_name, bool trace_at_cmd, int trace_protocol, int trace_mode=0);
This macro starts the trace for the selected parameter.
PARAMETERS
file_name: string
path of the trace file
trace_at_cmd: bool
turn trace AT commands ON/OFF
TRUE: ON
FALSE: OFF
trace_protocol: int
0 = NONE
1 = LEON-G1/SARA-G3
2 = LISA-U2/SARA-U2
3 = TOBY-L2/MPCI-L2
4 = TOBY-R2/LARA-R2
5 = TOBY-L4
6 = SARA-G4/SARA-N3
7 = LENA-R8
8 = SARA-R5/LEXI-R5
9 = LARA-R3
trace_mode: int
default=0
0 = default trace port
1 = Trace socket
RETURN VALUE
Return type: bool
true = if the requested feature successful
false = if the requested feature is failed
EXAMPLE
//Start tracing using trace port
MC_TRACE_START("C:\\traces\\trace_file", true, 0);
//Start tracing using the trace socket
MC_TRACE_START("C:\\traces\\trace_file", true, 0, 1);
bool MC_TRACE_STOP();
This macro stops tracing.
RETURN VALUE
Return type: bool
true = if the requested feature successful
false = if the requested feature is failed
EXAMPLE
MC_TRACE_STOP();
bool SET_TPORT_NAME(string tpName);
This macro sets the trace port name.
PARAMETERS
tpName: string
e.g. "COM0"
RETURN VALUE
Return type: bool
true = if the requested feature successful
false = if the requested feature is failed
EXAMPLE
SET_TPORT_NAME("COM1");
bool SET_TPORT_BAUD(int baud)
This macro sets the AT port baud rate.
PARAMETERS
baud: int
e.g. 9600, 115200, 230400, 460800, 921600, 3000000
RETURN VALUE
Return type: bool
true = if the requested feature successful
false = if the requested feature is failed
EXAMPLE
SET_TPORT_BAUD(115200);
This macro sets the AT port stop bits.
true... if the requested feature successful
false... if the requested feature is failed
- int type 1 or 2
SET_TPORT_STOP_BITS(1);
This macro sets the AT port data bits E.g.,
true... if the requested feature successful
false... if the requested feature is failed
- int type 8 or 7 or 6 or 5
SET_TPORT_DATA_BITS(8);
This macro sets the AT port flow control.
true... if the requested feature successful
false... if the requested feature is failed
- int type Input values(0:none, 1:hardware, 2:xon-xoff)
SET_TPORT_FLOW_CONTROL(1);
This macro sets the AT port parity.
true... if the requested feature successful
false... if the requested feature is failed
- int type 0:none, 1:even, 2:odd
SET_TPORT_PARITY(0);
This macro sets the socket IP and port.
true... if the requested feature successful
false... if the requested feature is failed
- string type com port name E.g., "192.168.10.11"
- int value of port E.g., 8080
SET_TRACE_SOCKET_PARAM("192.168.10.1",50000);
This macro sends a file to the modem FFS.
true... if file write is successful
false... if file write is failed
- string type file path "C:\test_dir\testfile.txt" or "C:/test_dir/testfile.txt"
Note: If the path is relative e.g. "file.txt" or "data\file.txt" the file should be present where the running script is present or inside the data folder in case of the later example. The data folder should be present where the running script is present.
A sample hierarchy is as below.
Atscript folder/
├── test.atl
└── data/
└── file.txt
MC_FFS_STORE("C:\\test_dir\\testfile.txt");
MC_FFS_STORE("data\\testfile.txt");
This macro retrieves a file from the modem FFS.
true... if file retrieve is successful
false... if file retrieve is failed
- string type file name "xyz.txt"
- string type file path "C:\test_dir\testfile.txt" or "C:/test_dir/test_file.txt"
MC_FFS_RETRIEVE("test_file.txt","C:\\test_dir\\test_file.txt");
This macro deletes a file from the modem FFS.
true... if file delete is successful
false... if file delete is failed
- string type filename "xyz.txt"
MC_FFS_DELETE("test_file.txt");
This macro deletes all files from the modem FFS.
true... if file delete is successful
false... if file delete is failed
MC_FFS_DELETE_ALL();
This macro turns AT terminal's logging ON/OFF.
true... if the requested feature successful
false... if the requested feature is failed
- bool type: (true:ON, false:OFF)
MC_TERMINAL_LOG(true);
This macro clears AT terminal's logging.
MC_TERMINAL_LOGCLEAR();
This macro returns the location of AT scripts in the system in string format.
ECHO(GETSCRIPTPATH());