蜂窝模组短信API实现接口。
更多...
#include <stdint.h>
#include "tuya_cloud_types.h"
浏览源代码.
|
|
#define | TUYA_SMS_MSG_LEN_MAX 140 |
| | 短信内容最大长度
|
| |
|
#define | TUYA_SMS_PHONENUM_LEN_MAX 42 |
| | 收发短信时,手机号码最大长度
|
| |
|
| enum | TUYA_CELLULAR_SMS_ENCODE_E {
TUYA_SMS_ISO8859_1
, TUYA_SMS_UTF8
, TUYA_SMS_UTF16BE
, TUYA_SMS_UTF16LE
,
TUYA_SMS_GSM
, TUYA_SMS_CP936
} |
| | 短信内容编码格式
|
| |
蜂窝模组短信API实现接口。
- 作者
- www.tuya.com
- 版权所有
- Copyright (c) tuya.inc 2021
◆ TUYA_CELLULAR_SMS_CB
短信接收回调函数接口原型
- 注解
- 回调函数中不要调用阻塞性函数,msg结构体内存由系统 负责分配和释放。
- 参数
-
- 返回
- 无
◆ tkl_cellular_sms_convert_str()
短信内容编码转换
When from_charset or to_charset is unknown or unsupported, return NULL. The returned pointer is allocated inside, caller should free it.
At most from_size byte count will be processed. When from_size is -1, process till null chracter.
null character will always be inserted into the output string. Invalid characters are replaced silently.
to_size can be NULL in case that the output byte count is not needed.
- 参数
-
| from | input string |
| from_size | input string byte count |
| from_chset | input string charset |
| to_chset | output string charset |
| to_size | output string byte count |
- 返回
- NULL: invalid parameters
- output string
◆ tkl_cellular_sms_mute()
| OPERATE_RET tkl_cellular_sms_mute |
( |
BOOL_T |
mute | ) |
|
设置短信接收时静音
- 注解
- 默认情况下,收到短信时,会通过扬声器播放提示音。通过该函数,可设置接收 短信时,不播放提示音。
- 参数
-
| mute | TRUE 静音 FALSE 短信接收时打开提示音 |
- 返回
- 0 设置成功 其它 设置失败
◆ tkl_cellular_sms_recv_cb_register()
注册短信接收回调函数
- 注解
- 该函数需在SIM卡激活前注册,否则可能引起异常或短信丢失。
- 参数
-
- 返回
- 0 注册成功 其它 注册失败
◆ tkl_cellular_sms_send()