GSM

This module implements a generic gsm interface. To function correctly it needs a gsm driver to be loaded, so that the module can use the driver to access the underlying hardware.

The link between the gsm module and the gsm driver is established without the programmer intervetion by the driver itself.

gethostbyname(hostname)

Translate a host name to IPv4 address format. The IPv4 address is returned as a string, such as “192.168.0.5”.

connect_net(apn, username = None, psw = None, auth = 'AUTH_DETECT')

Try to establish a link with the chosen Access Point Name apn. auth must be one of ‘AUTH_NONE’, ‘AUTH_PAP’, ‘AUTH_CHAP’, ‘AUTH_DETECT’ (default). username and psw are optional, depending on the operator.

An exception can be raised if the connection is not successful.

detach()

GSM deatch.

disconnect()

Deactivate APN connection. It is possible to disconnect without detaching, but not viceversa.

reconnect()

Reconnect if still attached.

activated()

Return APN connection status.