Module Gammu.Info

Informations on the phone.

type battery_charge = {
battery_type : battery_type;

(** Battery type. *)

battery_capacity : int;

(** Remaining battery capacity (in mAh). *)

battery_percent : int;

(** Remaining battery capacity in percent, -1 = unknown. *)

charge_state : charge_state;

(** Charge state. *)

battery_voltage : int;

(** Current battery voltage (in mV). *)

charge_voltage : int;

(** Voltage from charger (in mV). *)

charge_current : int;

(** Current from charger (in mA). *)

phone_current : int;

(** Phone current consumption (in mA). *)

battery_temperature : int;

(** Battery temperature (in degrees Celsius). *)

phone_temperature : int;

(** Phone temperature (in degrees Celsius). *)

}
type charge_state =
| BatteryPowered

(** Powered from battery *)

| BatteryConnected

(** Powered from AC, battery connected *)

| BatteryCharging

(** Powered from AC, battery is charging *)

| BatteryNotConnected

(** Powered from AC, no battery *)

| BatteryFull

(** Powered from AC, battery is fully charged *)

| PowerFault

(** Power failure *)

type battery_type =
| Unknown_battery

(** Unknown battery *)

| NiMH

(** NiMH battery *)

| LiIon

(** Lithium Ion battery *)

| LiPol

(** Lithium Polymer battery *)

type firmware = {
version : string;
ver_date : string;
ver_num : float;
}
type phone_model = {
model : string;

(** Model as returned by phone *)

number : string;

(** Identification by Gammu *)

irda : string;

(** Model as used over IrDA *)

}

Model identification, used for finding phone features.

type network = {
cid : string;

(** Cell ID (CID) *)

code : string;

(** GSM network code *)

state : network_state;

(** Status of network logging. *)

lac : string;

(** LAC (Local Area Code) *)

name : string;

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

gprs : gprs_state;

(** GRPS state *)

packet_cid : string;

(** Cell ID (CID) for packet network *)

packet_state : network_state;

(** Status of network logging for packet data. *)

packet_lac : string;

(** LAC (Local Area Code) for packet network *)

}

Current network informations

type gprs_state =
| Detached
| Attached
| Unknown_gprs
type network_state =
| HomeNetwork

(** Home network for used SIM card. *)

| NoNetwork

(** No network available for used SIM card. *)

| RoamingNetwork

(** SIM card uses roaming. *)

| RegistrationDenied

(** Network registration denied

  • card blocked or expired or disabled.

*)

| Unknown_network

(** Unknown network status. *)

| RequestingNetwork

(** Network explicitely requested by user. *)

type signal_quality = {
signal_strength : int;
signal_percent : int;
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
val firmware : t ‑> firmware
val hardware : t ‑> string
val imei : t ‑> string
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