是否支持发送中文短信?
Closed this issue · 5 comments
houaq commented
如题。
把example里的消息内容直接改成中文好像不行,收到中文是乱码。
lsongdev commented
Any questions ?
houaq commented
lsongdev commented
use PDU mode and try again ?
houaq commented
How to set PDU mode? Is there an option?
lsongdev commented
AT+CMGF[= [<mode>]]
Set command selects the format of messages used with send, list, read and write commands.
Parameter:
<mode>
0 - PDU mode, as defined in GSM 3.40 and GSM 3.41 (factory default)
1 - text mode
Note: issuing AT+CMGF<CR> is the same as issuing the Read command.
Note: issuing AT+CMGF=<CR> is the same as issuing the command AT+CMGF=0<CR>.
In gsm modem api:
const SMS_MODE = {
PDU: 0,
TEXT: 1
};
await modem.sms_mode(SMS_MODE.PDU);
await modem.sms_send('phone number', 'pdu string');