WebAPI/WebMobileConnection
< WebAPI
Jump to navigation
Jump to search
Goals
Expose information about the current mobile data connection to (certain) HTML content.
Proposed API
interface MobileConnection : EventTarget { /** * Indicates whether the device is connected to a mobile network. */ readonly attribute bool connected; /** * Indicates whether the connection is going through a foreign operator * (roaming) or not. */ readonly attribute bool roaming; /** * Operator name. */ readonly attribute string operator; /** * Type of connection. * * Possible values: 'gprs', 'edge', 'umts', 'hsdpa', 'evdo0', 'evdoa', 'evdob', etc. */ readonly attribute string type; /** * Signal strength as defined by 3GPP TS 27.007 specification, section 8.5. * * Possible values: * 0 -113 dBm or less * 1 -111 dBm * 2...30 -109 ... -53 dBm * 31 -51 dBm or greater * null if no signal strength (or signal) is available. */ readonly attribute short signalstrength; /** * Signal strength expressed as number of "bars". * * Possible values: 0 (no signal) to 5 (full signal). */ readonly attribute short bars; /** * The 'connectionchange' event is notified whenever one of the 'connected', * 'roaming', 'operator', 'type' attributes change, since typically many or * all of them change together. */ attribute EventListener onconnectionchange; /** * The 'signalstrengthchange' event is notified whenever the signal strength * changes value. The 'bars' attribute is updated accordingly. */ attribute EventListener onsignalstrengthchange; };