有关短信的的二个疑问(Port及长短信)

clubnekol 2009-07-30 11:16:21
小弟对BREW的短信有二个疑问,请高手指点一下
1. BREW在收、发短信时,可以指定Port的吗?如何指定呢?
2. BREW如果遇到讯息很长的短信,怎么发送,是分成多条短信发出吗?如何设定或实作长短信(是否需设置头文件?)
是否有sample code可以参考!?谢谢各位高手
...全文
1713 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
taoshahai 2010-01-05
  • 打赏
  • 举报
回复
=============================================================================

ITAPI_SendSMS()

Description:
This method is used to send SMS messages from the handset.This function can
be used to send text messages to either a specific BREW application on another handset
or a general text message to the handset. It sends messages to a destination mobile
number or an email ID. When this function is called, it is likely that it will result
in a SUSPEND/RESUME sequence to the BREW application. This is initiated by the handset
when it sends the SMS message out.~
The sequential flow of control is as follows:
~
1. The application invokes ITAPI_SendSMS()
2. The handset begins the process of sending the SMS message out
3. The notification function specified by pfn is invoked with the status of
the message delivery
*

Associated with this process, the application may receive EVT_APP_SUSPEND and
EVT_APP_RESUME events sometime after step 1.

Prototype:
int ITAPI_SendSMS
(
ITAPI *pITapi,
const char * pszDst,
const char * pszMsg,
AEECLSID clsDst,
PFNSMSSTATUS pfn,
void *pUser
)

Parameters:
pITapi : Pointer to the ITAPI Interface object
pszDst : Number or email ID of the destination where message must be sent to.
If this is set to NULL and if clsDst is non-zero, this function sends the EVT_APP_MESSAGE
event to the application (clsDst) on the local handset and the dwParam of that event
shall contain pszMsg. In this case, the return value of the function is the same
as the return value of ISHELL_SendEvent(). The notification function will not be
called since this is a local delivery of the message.
pszMsg : Text message to be sent to the destination mobile.
ITAPI_SendSMS() expects text message to be in device encoding and uses byte,
double byte for device encoding UNICODE, set to 0 as message delimiter.
If pszMsg is set to NULL, the function returns EBADPARM
clsID : If non-zero, it specifies the class ID of the BREW application on the
destination mobile to which this message must be sent
pfn : Notification function that is invoked to inform the status of the SMS
message sent
pUser : User data to be sent to the notification function
Examples:
===pre>
if (nDeviceEncoding == AEE_ENC_UNICODE)
{
ITAPI_SendSMS (pITapi, "8581112222", (char*)STRTOWSTR("Hello World", pBuffer, nBufSize), 0, MyMOSMSNotify, pMe );
ITAPI_SendSMS ( pITapi, "foo@sample.com", (char*)STRTOWSTR("Hello World", pBuffer, nBufSize), 0, MyMOSMSNotify, pMe );
}
else
{
ITAPI_SendSMS (pITapi, "8581112222", "Hello World", 0, MyMOSMSNotify, pMe );
ITAPI_SendSMS ( pITapi, "foo@sample.com", "Hello World", 0, MyMOSMSNotify, pMe );
}
===/pre>

Return Value:
SUCCESS, if message is accepted for delivery by ITAPI. This success doesn't indicate
the successful submission of the message to SMSC for delivery.

EITEMBUSY, if ITAPI determines that the device is busy and cannot send this SMS.
Generally, a SMS message cannot be sent if the notification function has not yet been
called for a previously sent SMS message.

EBADPARM, if pszMsg is NULL or pszDst and clsDst are both set to NULL.

EBADCLASS, if TAPI is not enabled on this handset.

EFAILED, if there is a general failure in sending the SMS.


Examples:
===pre>
ITAPI_SendSMS(pITapi, "8581112222", "Hello World", 0, MyMOSMSNotify, pMe);
ITAPI_SendSMS(pITapi, "foo@sample.com", "Hello World",0,MyMOSMSNotify,pMe);
===/pre>

Comments:
NOTE: This function may cause some devices to experience difficulties when attempting
to send long messages.

NOTE: The status passed to the notification function will be success if message was
successfully submitted to SMSC for delivery. The status passed to the notification
function can be EITEMBUSY or EFAILED to indicate problem in submitting the message
to SMSC for delivery.

Version:
Introduced BREW Client 2.0

See Also:
None
clubnekol 2009-08-20
  • 打赏
  • 举报
回复
kingfenggg
讯息没有长度的限制吗?
kingfenggg 2009-08-18
  • 打赏
  • 举报
回复
int ITAPI_SendSMS

(
ITAPI *pITapi,
const char * pszDst,
const char * pszMsg,
AEECLSID clsDst,
PFNSMSSTATUS pfn,
void *pUser

)


参数:
pITapi: 指向 ITAPI 接口对象的指针

pszDst: 发送消息的目标号码或电子邮件 ID。 如果将其设为 NULL,并且 clsDst 非零,则此函数将向本地手持设备上的应用程序 (clsDst) 发送 EVT_APP_MESSAGE 事件,而该事件的 dwParam 将包含 pszMsg。 这种情况下,该函数的返回值与 ISHELL_SendEvent() 的返回值相同。 由于是本地发送消息,因此不会调用通知函数。

pszMsg: 要发送至目标移动设备的文本消息。 如果设为 NULL,函数将返回 EBADPARM

clsID: 如果非零,则指定目标移动设备上接收该消息的 BREW 应用程序的ClassID

pfn: 通知 SMS 消息发送状态所调用的通知函数

pUser: 发送至通知函数的用户数据

示例: ITAPI_SendSMS (pITapi, "8581112222", "Hello World", 0, MyMOSMSNotify, pMe ); ITAPI_SendSMS ( pITapi, "foo@sample.com", "Hello World", 0, MyMOSMSNotify, pMe );

clubnekol 2009-08-04
  • 打赏
  • 举报
回复
自顶一下,还有人遇到这种长短信的case吗
clubnekol 2009-07-30
  • 打赏
  • 举报
回复
BREW是不是有没有设port都无所谓呢?好像是用class id来区分...
  • 打赏
  • 举报
回复
Port 应该是teleserviceid吧,teleserviceid 可以再mif中设定,收是没问题的,发没试过
长短信的分割可能需要OEM层的支持

2,854

社区成员

发帖
与我相关
我的任务
社区描述
本论坛以AI、WoS 、XR、IoT、Auto、生成式AI等核心板块组成,为开发者提供便捷及高效的学习和交流平台。 高通开发者专区主页:https://qualcomm.csdn.net/
人工智能物联网机器学习 技术论坛(原bbs) 北京·东城区
社区管理员
  • csdnsqst0050
  • chipseeker
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧