Files
quectel-rgmii-toolkit/simpleadmin/www/cgi-bin/get_sms
2024-05-25 07:54:30 +08:00

12 lines
282 B
Bash

#!/bin/bash
SMS_FORMAT="AT+CMGF=1"
SMS_LIST="AT+CMGL=\"ALL\""
send_at_command() {
local command="$1"
echo -en "$command\r\n" | microcom -t 2000 /dev/ttyOUT2
}
send_at_command "$SMS_FORMAT"
runcmd=$(send_at_command "$SMS_LIST")
echo "Content-type: text/plain"
echo "$runcmd"