mozilla
Your Search Results

    MozMobileConnection Redirect 1

    Non-standard
    This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

    This API is available on Firefox OS for certified applications only.

    Summary

    This API is used to get information about the current mobile voice and data connection states of the device. It is accessible through navigator.mozMobileConnection.

    This object also includes ICC-related (SIM/RUIM card) functionalities, such as :

    • entering PIN, PIN2, PUK, PUK2 to unlock various states of the SIM card.
    • changing the PIN (also serves as enabling/disabling the PIN lock.)

    Interface overview

    callback EventHandler = any (Event event);
    
    interface MozMobileConnection : EventTarget
    {
      const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
      const long ICC_SERVICE_CLASS_DATA = (1 << 1);
      const long ICC_SERVICE_CLASS_FAX = (1 << 2);
      const long ICC_SERVICE_CLASS_SMS = (1 << 3);
      const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
      const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
      const long ICC_SERVICE_CLASS_PACKET = (1 << 6);
      const long ICC_SERVICE_CLASS_PAD = (1 << 7);
      const long ICC_SERVICE_CLASS_MAX = (1 << 7);
    
      readonly attribute MozMobileConnectionInfo voice;
      readonly attribute MozMobileConnectionInfo data;
      readonly attribute DOMString networkSelectionMode;
      readonly attribute DOMString iccId;
    
      DOMRequest getNetworks();
      DOMRequest selectNetwork(MozMobileNetworkInfo network);
      DOMRequest selectNetworkAutomatically();
      DOMRequest sendMMI(DOMString mmi);
      DOMRequest cancelMMI();
      DOMRequest setCallForwardingOption(MozMobileCFInfo CFInfo);
      DOMRequest getCallForwardingOption(unsigned short reason);
    
      attribute EventHandler onvoicechange;
      attribute EventHandler ondatachange;
      attribute EventHandler onussdreceived;
      attribute EventHandler ondataerror;
      attribute EventHandler oncfstatechange;
    };
    

    Properties

     
    MozMobileConnection.voice Read only
    A MozMobileConnectionInfo object that gives access to information about the voice connection.
    MozMobileConnection.data Read only
    A MozMobileConnectionInfo object that gives access to information about the data connection.
    MozMobileConnection.iccId Read only
    A string that indicates the Integrated Circuit Card Identifier of the SIM this mobile connection corresponds to.
    MozMobileConnection.networkSelectionMode Read only
    A string that indicates the selection mode of the voice and data networks.
    MozMobileConnection.oncfstatechange
    A handler for the cfstatechange event. This event is fired when the call forwarding state changes.
    MozMobileConnection.ondatachange
    A handler for the datachange event. This event is fired whenever the data connection object changes values.
    MozMobileConnection.ondataerror
    A handler for the dataerror event. This event is fired whenever the data connection object receive an error from the RIL.
    MozMobileConnection.onussdreceived
    A handler for the ussdreceived event. This event is fired whenever a new USSD message is received.
    MozMobileConnection.onvoicechange
    A handler for the voicechange event. This event is fired whenever the voice connection object changes.
    MozMobileConnection.voice Read only
    A MozMobileConnectionInfo object that gives access to information about the voice connection.

    Constants

    • ICC_SERVICE_CLASS_VOICE
    • ICC_SERVICE_CLASS_DATA
    • ICC_SERVICE_CLASS_FAX
    • ICC_SERVICE_CLASS_SMS
    • ICC_SERVICE_CLASS_DATA_SYNC
    • ICC_SERVICE_CLASS_DATA_ASYNC
    • ICC_SERVICE_CLASS_PACKET
    • ICC_SERVICE_CLASS_PAD
    • ICC_SERVICE_CLASS_MAX

    Methods

    Note: All original methods from the MozMobileConnection interface are fully asynchronous. They all return a DOMRequest which has a onsuccess and onerror event handler to handle the success or failur of the method call.

    MozMobileConnection.cancelMMI()
    Cancel the current MMI request if one exists.
    MozMobileConnection.getCallForwardingOption()
    Queries current call forward options.
    MozMobileConnection.getNetworks()
    Search for available networks.
    MozMobileConnection.selectNetwork()
    Manually selects a network, overriding the radio's current selection.
    MozMobileConnection.selectNetworkAutomatically()
    Tell the radio to automatically select a network.
    MozMobileConnection.sendMMI()
    Send a MMI message.
    MozMobileConnection.setCallForwardingOption()
    Configures call forward options.

    The MozMobileConnection interface also inherit from the EventTarget interface

    EventTarget.addEventListener()
    Register an event handler of a specific event type on the EventTarget.
    EventTarget.removeEventListener()
    Removes an event listener from the EventTarget.
    EventTarget.dispatchEvent()
    Dispatch an event to this EventTarget.

    Specification

    Not part of any specification

    See also

    Document Tags and Contributors

    Contributors to this page: Sheppy
    Last updated by: Sheppy,