Feature Phone如何客制 化AT command
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
如何客制化AT Command,如何返回具体的内容给AP。
[SOLUTION]
custom\common\ps\customer_at_command.ccustom_command_hdlr()AT
sample codeAP
if (strcmp(cmd_name, “GPLMN") == 0)
{
/* BEGIN: do the following parsing and correspondent action */
kal_uint8 buffer[40];
kal_uint16 string_length = 0;
sprintf(buffer, “+GPLMN: \”%s\”“,g_plmn); //APbuffer+GPLMNAT+GPLMNg_plmn string_length = strlen((char *)buffer);
rMMI_write_to_UART((kal_uint8*)buffer, string_length, KAL_TRUE); //bufferAP
/* END: do the following parsing and correspondent action */
/* generate final result code: "OK" or "ERROR" */
if() // if operation is success
{
sprintf(buffer, "OK");
rmmi_write_to_uart((kal_uint8*)buffer, strlen(buffer), KAL_TRUE);
}
else if () // if operation is fail
{
sprintf(buffer, "ERROR");
rmmi_write_to_uart((kal_uint8*)buffer, strlen(buffer), KAL_TRUE);
}
return KAL_TRUE;
}
如何客制化AT Command,如何返回具体的内容给AP。
[SOLUTION]
custom\common\ps\customer_at_command.ccustom_command_hdlr()AT
sample codeAP
if (strcmp(cmd_name, “GPLMN") == 0)
{
/* BEGIN: do the following parsing and correspondent action */
kal_uint8 buffer[40];
kal_uint16 string_length = 0;
sprintf(buffer, “+GPLMN: \”%s\”“,g_plmn); //APbuffer+GPLMNAT+GPLMNg_plmn string_length = strlen((char *)buffer);
rMMI_write_to_UART((kal_uint8*)buffer, string_length, KAL_TRUE); //bufferAP
/* END: do the following parsing and correspondent action */
/* generate final result code: "OK" or "ERROR" */
if() // if operation is success
{
sprintf(buffer, "OK");
rmmi_write_to_uart((kal_uint8*)buffer, strlen(buffer), KAL_TRUE);
}
else if () // if operation is fail
{
sprintf(buffer, "ERROR");
rmmi_write_to_uart((kal_uint8*)buffer, strlen(buffer), KAL_TRUE);
}
return KAL_TRUE;
}
