freesmartphone.org GSM Device Interface

Description

The Device interface is used to give information about the GSM or CDMA device and its capabilities. Use it also to enable or disable the RF subsystem (which is mandatory for implementing a flight mode).

Namespace

org.freesmartphone.GSM.Device

Methods

Signals

Properties

None

Errors

None

Methods

GetFunctionality ( ) → sbs

Description: Retrieve the current functionality status of the device.

Returns:

s: level The functionality level. Expected values are:

  • “minimal”: The device is in maximum powersave mode, SIM access is not possible
  • “airplane”: The device is in airplane mode (RF receivers and transmitters have been turned off), SIM access is possible
  • “full”: The device operates with maximum functionality (all units are powered up).

b: autoregister Whether the device tries to maintain registration with a provider. This parameter is only valid, if level = “full”.

s: pin The SIM PIN being used to authenticate if necessary, or an empty string. This parameter is only valid, if level = “full” or “airplane”.

SetFunctionality ( sbs )

Description: Set the functionality status for this device.

Parameters:*

s: level See GetFunctionality

b: autoregister Whether the device should try to maintain registration with a provider. This parameter is only valid, if level = “full”.

s: pin The SIM PIN being used to authenticate if necessary, or an empty string. This parameter is only valid, if level = “full” or “airplane”.

GetFeatures ( ) → a{sv}

Description: Get information about the telephony features supported by this device.

Returns:

a{sv}: features The telephony features supported by this device. Valid tuples are:

  • (“voice”, bool) = true, if the device supports voice calls,
  • (“csd”, bool) = true, if the device supports circuit-switched (data) calls,
  • (“gsm”, bool) = true, if the device can operate in a GSM network,
  • (“cdma”, bool) = true, if the device can operate in a CDMA network,
  • (“pdp”, string) = supported pdp classes, if the device supports packet data communication,
  • (“fax”, string) = supported fax classes, if the device supports fax communication,
  • (“facilities”, string) = supported security facilities.

GetDeviceStatus ( ) → s

Description: Retrieve the current device status. SIM commands, such as ListPhonebooks can not be performed before the device is in the status ‘alive-sim-ready’.

Returns:

s: status The device status. Expected values are:

  • “unknown” = Device status could not be found,
  • “closed” = Device is present, but not opened,
  • “initializing” = Device is being opened,
  • “alive-no-sim” = Device is operating without a SIM card,
  • “alive-sim-locked” = Device is operating, SIM card is locked,
  • “alive-sim-unlocked” = Device is operating, SIM card unlocked,
  • “alive-sim-ready” = Device is operating, SIM card is ready for access,
  • “alive-registered” = Device is operating and camped to the network,
  • “suspending” = Device is suspending,
  • “suspended” = Device is suspended,
  • “resuming” = Device is resuming,
  • “closing” = Device is closing.

GetSpeakerVolume ( ) → i

Description: Retrieve the current loudspeaker volume.

Returns:

i: volume The volume in percent (0-100).

SetSpeakerVolume ( i )

Description: Set the current loudspeaker volume.

Implementation Note

This maps to the GSM 07.07 command +CLVL=… see 3GPP TS 07.07 Chapter 8.2.3.

Parameters:*

i: volume The volume in percent (0-100).

GetMicrophoneMuted ( ) → b

Description: Retrieve whether the microphone is currently muted.

Implementation Note

This maps to the GSM 07.07 command +CMUT?, see 3GPP TS 07.07 Chapter 8.2.4.

Returns:

b: muted True, if the microphone is muted. False, otherwise.

SetMicrophoneMuted ( b )

Description: Mute or unmute the microphone.

Implementation Note

This maps to the GSM 07.07 command +CMUT=… see 3GPP TS 07.07 Chapter 8.2.4.

Parameters:*

b: muted True, to mute the microphone. False, otherwise.

Signals

DeviceStatus ( s )

Description: Sent on a change in device status.

Parameters:

s: status The device status. See GetDeviceStatus for expected values.

KeypadEvent ( sb )

Description: Sent, when a keypad input event occurs.

Parameters:

s: name The name of the event source.

b: pressed True, if the keypad key has been pressed. False, otherwise.