beautypg.com

2 mdm2.receive(timeout), 3 mdm2.read(), 4 mdm2.sendbyte(byte, timeout) – Rainbow Electronics GM862-GPS User Manual

Page 26

background image





Easy Script

in Python

80000ST10020a Rev.8 - 01/10/08

Reproduction forbidden without Telit Communications S.p.A. written authorization - All Rights Reserved

page 26 of 100

2.3.2 MDM2.receive(timeout)


This command receives a string from AT command interface waiting for it until timeout is expired.
Return value will be the first string received no matter of how long the timeout is. Request to Send
(RTS) is set to ON. Input parameter timeout is a Python integer, which is measured in 1/10s, and
represents the maximum time of waiting for the string from AT command interface.
Return value is a Python string which is an empty string if timeout has expired without any data
received otherwise the string contains data received.

Example:

a = MDM2.receive(15)

receives a string from AT command handling, possibly waiting for it for 1.5 s, assigning return value to
a.

NOTE: The buffer available for MDM2.receive command is 4096 bytes.

2.3.3 MDM2.read()


This command receives a string from AT command interface without waiting for it. Request to Send
(RTS) is set to ON. No input parameter.
Return value is a Python string which is an empty string if no data received otherwise the string
contains data received in the moment when command is activated.

Example:

a = MDM2.read()

receives a string from AT command handling, assigning return value to a.

NOTE: The buffer available for MDM2.read command is 4096 bytes

2.3.4 MDM2.sendbyte(byte, timeout)


This command sends a byte to AT command interface. First input parameter byte is any Python byte
that will be to send to AT command interface. It can also be zero.
Second input parameter timeout is a Python integer which is the value in 1/10 s to wait for the byte to
be sent to AT command interface before timeout expires. Waiting time is caused by hardware flow
control.