nsIRadioInterfaceLayer 编辑

dom/system/gonk/nsIRadioInterfaceLayer.idlScriptable Used to implement the interface between the Telephony API and the radio hardware in a telephone. 1.0 66 Introduced Gecko 12.0 Inherits from: nsISupports Last changed in Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11)

Implemented by: @mozilla.org/telephony/system-worker-manager;1. To create an instance, use:

var radioInterfaceLayer = Components.classes["@mozilla.org/telephony/system-worker-manager;1"]
                          .getService(Components.interfaces.nsIInterfaceRequestor)
                          .createInstance(Components.interfaces.nsIRadioInterfaceLayer);

Method overview

void answerCall(in unsigned long callIndex);
void deactivateDataCall(in DOMString cid, in DOMString reason);
void dial(in DOMString number);
void enumerateCalls(in nsIRILTelephonyCallback callback);
void getDataCallList();
unsigned short getNumberOfMessagesForText(in DOMString text);
void hangUp(in unsigned long callIndex);
void registerCallback(in nsIRILTelephonyCallback callback);
void registerDataCallCallback(in nsIRILDataCallback callback);
void rejectCall(in unsigned long callIndex);
void sendSMS(in DOMString number, in DOMString message, in long requestId, in unsigned long long processId);
void setupDataCall(in long radioTech, in DOMString apn, in DOMString user, in DOMString passwd, in long chappap, in DOMString pdptype);
void startTone(in DOMString dtmfChar);
void stopTone();
void unregisterCallback(in nsIRILTelephonyCallback callback);
void unregisterDataCallCallback(in nsIRILDataCallback callback);

Attributes

AttributeTypeDescription
currentStatejsvalRead only. Obsolete since Gecko 13.0
microphoneMutedbool 
radioStatejsvalRead only.
speakerEnabledbool 

Constants

Call state constants

ConstantValueDescription
CALL_STATE_UNKNOWN0 
CALL_STATE_DIALING1 
CALL_STATE_ALERTING2
CALL_STATE_BUSY3 
CALL_STATE_CONNECTING4 
CALL_STATE_CONNECTED5 
CALL_STATE_HOLDING6 
CALL_STATE_HELD7 
CALL_STATE_RESUMING8 
CALL_STATE_DISCONNECTING9 
CALL_STATE_DISCONNECTED10 
CALL_STATE_INCOMING11 
DATACALL_STATE_UNKNOWN0 
DATACALL_STATE_CONNECTING1 
DATACALL_STATE_CONNECTED2 
DATACALL_STATE_DISCONNECTING3 
DATACALL_STATE_DISCONNECTED4 
CALL_STATE_RINGING2Obsolete since Gecko 14.0

Methods

answerCall()

void answerCall(
  in unsigned long callIndex
);
Parameters
callIndex
Missing Description
Exceptions thrown
Missing Exception
Missing Description

deactivateDataCall()

void deactivateDataCall(
  in DOMString cid,
  in DOMString reason
);
Parameters
cid
Missing Description
reason
Missing Description
Exceptions thrown
Missing Exception
Missing Description

dial()

Functionality for making and managing phone calls.

void dial(
  in DOMString number
);
Parameters
number
Missing Description
Exceptions thrown
Missing Exception
Missing Description

enumerateCalls()

Will continue calling callback.enumerateCallState until the callback returns false.

void enumerateCalls(
  in nsIRILTelephonyCallback callback
);
Parameters
callback
Missing Description
Exceptions thrown
Missing Exception
Missing Description

getDataCallList()

void getDataCallList();
Parameters

None.

Exceptions thrown
Missing Exception
Missing Description

getNumberOfMessagesForText()

Returns the number of multi-part SMS needed for a given text (160 characters for one SMS).

unsigned short getNumberOfMessagesForText(
  in DOMString text
);
Parameters
text
The body text of an SMS.
Return value

Unsigned short. Number of SMS needed.

hangUp()

void hangUp(
  in unsigned long callIndex
);
Parameters
callIndex
Missing Description
Exceptions thrown
Missing Exception
Missing Description

registerCallback()

void registerCallback(
  in nsIRILTelephonyCallback callback
);
Parameters
callback
Missing Description
Exceptions thrown
Missing Exception
Missing Description

registerDataCallCallback()

void registerDataCallCallback(
  in nsIRILDataCallback callback
);
Parameters
callback
Missing Description
Exceptions thrown
Missing Exception
Missing Description

rejectCall()

void rejectCall(
  in unsigned long callIndex
);
Parameters
callIndex
Missing Description
Exceptions thrown
Missing Exception
Missing Description

sendSMS()

Sends a message to a specified number.

void sendSMS(
  in DOMString number,
  in DOMString message,
  in long requestId,
  in unsigned long long processId
);
Parameters
number
A DOMString with a telephone number to send to.
message
The text message as a DOMString.
requestId
Missing Description
processId
Missing Description

setupDataCall()

PDP APIs.

void setupDataCall(
  in long radioTech,
  in DOMString apn,
  in DOMString user,
  in DOMString passwd,
  in long chappap,
  in DOMString pdptype
);
Parameters
radioTech
Missing Description
apn
Missing Description
user
Missing Description
passwd
Missing Description
chappap
Missing Description
pdptype
Missing Description
Exceptions thrown
Missing Exception
Missing Description

startTone()

void startTone(
  in DOMString dtmfChar
);
Parameters
dtmfChar
Missing Description
Exceptions thrown
Missing Exception
Missing Description

stopTone()

void stopTone();
Parameters

None.

Exceptions thrown
Missing Exception
Missing Description

unregisterCallback()

void unregisterCallback(
  in nsIRILTelephonyCallback callback
);
Parameters
callback
Missing Description
Exceptions thrown
Missing Exception
Missing Description

unregisterDataCallCallback()

void unregisterDataCallCallback(
  in nsIRILDataCallback callback
);
Parameters
callback
Missing Description
Exceptions thrown
Missing Exception
Missing Description

Remarks

 

See also

 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:33 次

字数:15256

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文