TECHNICAL MANUAL
Telit GM862-GPS
Quad Band GPS Data Terminal Module
Pag.35 of 79
Rev. 0
3.13.2 Python Build-in Custom Modules
Several build in custom modules have been included in the python core, specifically aimed
at the hardware environment of the module.
The build in modules included are:
MDM
: interface between Python and mobile internal AT command handling;
SER
: interface between Python and mobile internal serial port ASC0 direct handling;
GPIO
: interface between Python and mobile internal general purpose input output direct
handling;
MOD
: interface between Python and mobile miscellaneous functions.
IIC
: custom software Inter IC bus that can be mapped on creation over almost any GPIO
pin available.
SPI
: custom software Serial Protocol Interface bus that can be mapped on creation over
almost any GPIO pin available.
GPS
: custom software interface for GPS data stream coming from GPS chipset.
3.13.2.1
MDM built-in module
MDM built-in module is the interface between Python and the module AT command parser
engine.
You need to use MDM built-in module if you want to send AT commands from Python
script to the device and to receive responses from the device into your Python script.
Default start configuration is echo disabled (ATE0) and long form (verbose) return codes
(ATV1),
If you want to use MDM built-in module you need to import it first:
import MDM
then you can use MDM built-in module methods like in the following example:
a = MDM.send('AT', 0)
b = MDM.sendbyte(0x0d, 0)
c = MDM.receive(10)
which sends 'AT' and receives 'OK'.
More details about MDM built-in module methods are in the following paragraphs.
3.13.2.2 MDM.send(string,
timeout)
Sends a string to AT command interface.
First input parameter string is a Python string which is the string to send to AT command
interface.
Second input parameter timeout is a Python integer which is the value in 1/10 s to wait for
the string to be sent to AT command interface before timeout expires. Waiting time is
caused by flow control.
Return value is a Python integer which is -1 if timeout expired otherwise is 1.
Example:
a = MDM.send('AT', 5)
sends string 'AT' to AT command handling, possibly waiting for 0.5 s, assigning return
value to a.