4 ser built-in module, 1 ser.send(string) – Rainbow Electronics GM862-GPS User Manual
Page 30

Easy Script
in Python
80000ST10020a Rev.8 - 01/10/08
Reproduction forbidden without Telit Communications S.p.A. written authorization - All Rights Reserved
page 30 of 100
2.4 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 its data (NMEA for example). SER built-in module has also been improved lately with the
possibility to control physical lines.
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.set_speed('9600')
b = SER.send('test')
c = SER.sendbyte(0x0d)
d = SER.receive(10)
which sends 'test' followed by
More details about SER built-in module methods can be found in the following paragraphs.
2.4.1 SER.send(string)
This command sends a string to the serial port TXD/RXD. Input parameter string is a Python string
that will be 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.
NOTE: the buffer available for SER.send(string) command is 4096 bytes
5
5
For the products with the following old Order-Num. 3390250656, 3390250654 and 3990150466 the available
buffer is 2048 bytes