package gammu

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Informations on the phone.

type battery_charge = {
  1. battery_type : battery_type;
    (*

    Battery type.

    *)
  2. battery_capacity : int;
    (*

    Remaining battery capacity (in mAh).

    *)
  3. battery_percent : int;
    (*

    Remaining battery capacity in percent, -1 = unknown.

    *)
  4. charge_state : charge_state;
    (*

    Charge state.

    *)
  5. battery_voltage : int;
    (*

    Current battery voltage (in mV).

    *)
  6. charge_voltage : int;
    (*

    Voltage from charger (in mV).

    *)
  7. charge_current : int;
    (*

    Current from charger (in mA).

    *)
  8. phone_current : int;
    (*

    Phone current consumption (in mA).

    *)
  9. battery_temperature : int;
    (*

    Battery temperature (in degrees Celsius).

    *)
  10. phone_temperature : int;
    (*

    Phone temperature (in degrees Celsius).

    *)
}
and charge_state =
  1. | BatteryPowered
    (*

    Powered from battery

    *)
  2. | BatteryConnected
    (*

    Powered from AC, battery connected

    *)
  3. | BatteryCharging
    (*

    Powered from AC, battery is charging

    *)
  4. | BatteryNotConnected
    (*

    Powered from AC, no battery

    *)
  5. | BatteryFull
    (*

    Powered from AC, battery is fully charged

    *)
  6. | PowerFault
    (*

    Power failure

    *)
and battery_type =
  1. | Unknown_battery
    (*

    Unknown battery

    *)
  2. | NiMH
    (*

    NiMH battery

    *)
  3. | LiIon
    (*

    Lithium Ion battery

    *)
  4. | LiPol
    (*

    Lithium Polymer battery

    *)
type firmware = {
  1. version : string;
  2. ver_date : string;
  3. ver_num : float;
}
type phone_model = {
  1. model : string;
    (*

    Model as returned by phone

    *)
  2. number : string;
    (*

    Identification by Gammu

    *)
  3. irda : string;
    (*

    Model as used over IrDA

    *)
}

Model identification, used for finding phone features.

type network = {
  1. cid : string;
    (*

    Cell ID (CID)

    *)
  2. code : string;
    (*

    GSM network code

    *)
  3. state : network_state;
    (*

    Status of network logging.

    *)
  4. lac : string;
    (*

    LAC (Local Area Code)

    *)
  5. name : string;
    (*

    Name of current netwrok as returned from phone (or empty)

    *)
  6. gprs : gprs_state;
    (*

    GRPS state

    *)
  7. packet_cid : string;
    (*

    Cell ID (CID) for packet network

    *)
  8. packet_state : network_state;
    (*

    Status of network logging for packet data.

    *)
  9. packet_lac : string;
    (*

    LAC (Local Area Code) for packet network

    *)
}

Current network informations

and gprs_state =
  1. | Detached
  2. | Attached
  3. | Unknown_gprs
and network_state =
  1. | HomeNetwork
    (*

    Home network for used SIM card.

    *)
  2. | NoNetwork
    (*

    No network available for used SIM card.

    *)
  3. | RoamingNetwork
    (*

    SIM card uses roaming.

    *)
  4. | RegistrationDenied
    (*

    Network registration denied

    • card blocked or expired or disabled.
    *)
  5. | Unknown_network
    (*

    Unknown network status.

    *)
  6. | RequestingNetwork
    (*

    Network explicitely requested by user.

    *)
type signal_quality = {
  1. signal_strength : int;
  2. signal_percent : int;
  3. bit_error_rate : int;
}

Information about signal quality, all these should be -1 when unknown.

val network_code_name : string -> string

network_code_name code returns the name the network designed by the code code, of the form "[0-9]{3} [0-9]{2}".

val country_code_name : string -> string

country_code_name code returns the name of the country designed by the code code, of the form "[0-9]{3}" (the first 3 digits of the network code).

val battery_charge : t -> battery_charge
  • returns

    information about battery charge and phone charging state.

val firmware : t -> firmware
val hardware : t -> string
val imei : t -> string
  • returns

    IMEI (International Mobile Equipment Identity) / Serial Number

val manufacture_month : t -> string
val manufacturer : t -> string
val model : t -> string
val model_info : t -> phone_model
val network_info : t -> network
val product_code : t -> string
val signal_quality : t -> signal_quality