![Telit Wireless Solutions GM862GPS Series Скачать руководство пользователя страница 38](http://html1.mh-extra.com/html/telit-wireless-solutions/gm862gps-series/gm862gps-series_technical-manual_1083661038.webp)
TECHNICAL MANUAL
Telit GM862-GPS
Quad Band GPS Data Terminal Module
Pag.38 of 79
Rev. 0
Example:
MDM.setRTS(1)
sets RTS to ON in AT command handling.
3.13.2.13 MDM.setDTR()
Sets Data Terminal Ready (DTR) in AT command interface.
Input parameter is a Python integer which is 0 if setting DTR to OFF or 1 if setting DTR to
ON.
No return value.
Example:
MDM.setDTR(0)
sets DTR to OFF in AT command handling.
3.13.3 SER built-in module
SER built-in module is the interface between Python core and the device serial port over
the RXD/TXD pins direct handling.
You need to use SER built-in module if you want to send data from Python script to serial
port and to receive data from serial port ASC0 to Python script.
This serial port handling module can be used for example to interface the module with an
external device such as a GPS and read/send it's data (NMEA for example).
If you want to use SER built-in module you need to import it first:
import SER
then you can use SER built-in module methods like in the following example:
a = SER.SetSpeed('9600')
b = SER.send('test')
c = SER.sendbyte(0x0d)
d = SER.receive(10)
which sends 'test' followed by CR and receives data waiting for one second.
More details about SER built-in module methods are in the following paragraphs.
3.13.3.1 SER.send(string)
Sends a string to the serial port TXD/RXD.
Input parameter string is a Python string which is the string to send to serial port ASC0.
Return value is a Python integer which is -1 if an error occurred otherwise is 1.
Example:
a = SER.send('test')
sends string 'test' to serial port ASC0 handling, assigning return value to a.
3.13.3.2 SER.receive(timeout)
Receives a string from serial port TXD/RXD waiting for it until timeout is expired.
Input parameter timeout is a Python integer which is the value in 1/10 s to wait for a string
from serial port before timeout expires.
Return value is a Python string which is an empty string if timeout expired without any data
received otherwise is the string containing data received.
Example:
a = SER.receive(15)