使用GSM模块(SIM9000mini)均用到AT指令,通过上位机直接修改接收电话或信息的手机号,将上位机传下来的Unicode码转换成字符串直接存入consumer_number中,意即
将一整条AT指令
unsigned char message_number[]={"AT+CMGS=\"00310037003800350031003000300030003900300037\"\r\n"};
拆开写
unsigned char messager_number[100]= "AT+CMGS=\"";
unsigned char consumer_number[]="00310037003800310032003300340035003600370038";
unsigned char messager_number_end[44] = "\"\\r\\n";
void main()
{
UART1_config(); //串口1初始化
strcat(messager_number,consumer_number);
strcat(messager_number,messager_number_end);
uart1_printf(messager_number);
while(1);
}
运行效果: