beautypg.com

5 mdm2.receivebyte(timeout), 6 mdm2.readbyte(), 7 mdm2.getdcd() – Rainbow Electronics GM862-GPS User Manual

Page 27

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 27 of 100

Return value is a Python integer which is -1 if timeout expired otherwise is 1.

Example:

b = MDM2.sendbyte(0x0d, 0)

sends byte 0x0d, that is , to AT command handling, without waiting, assigning return value to b.

2.3.5 MDM2.receivebyte(timeout)

This command receives a byte from AT command interface waiting for it until timeout is expired.
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 integer which is -1 if timeout expired without any data received otherwise is
the byte value received. It can also be zero.

Example:

b = MDM2.receivebyte(20)

receives a byte from AT command handling, possibly waiting for it for 2.0 s, assigning return value to
b.

2.3.6 MDM2.readbyte()


This command receives a byte from AT command interface without waiting for it. Request to Send
(RTS) is set to ON. It has no input parameter.
Return value is a Python integer which is -1 if no data received otherwise is the byte value received. It
can also be zero.

Example:

b = MDM2.readbyte()

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

2.3.7 MDM2.getDCD()


This command gets Carrier Detect (DCD) from AT command interface. It has no input parameter.
Return value is a Python integer which is 0 if DCD is set to OFF or 1 if DCD is set to ON.

Example:

cd = MDM2.getDCD()