factory.cpp的main函数下
#if 1
if(is_pc_control(usb_com_port))
{
pthread_create(&read_thread, NULL, read_data_thread_callback, NULL);
LOGD(TAG "after create pthread");
ata_status = 1;
pc_control_mode(usb_com_port);
LOGD(TAG "pc control stops in if()!\n");
ata_status = 0;
}
#else
//end add at order teset current
//for ata test
at_command_processor();
//add at order teset current
#endif
此处是田大师修改,ATA测试判定条件 is_pc_control,然后调用的查询函数,仅仅 用到如下一个数组,
故若是增加一个ATA测试项,仅需要在如下数组增加即可,相应逻辑请在 read_data_thread_callback下增加。
item_t pc_control_items[] =
{
item(ITEM_FM, "AT+FM"),
item(ITEM_MEMCARD, "AT+MEMCARD"),
item(ITEM_SIM, "AT+SIM"),
item(ITEM_GPS, "AT+GPS"),
item(ITEM_EMMC, "AT+EMMC"),
item(ITEM_WIFI, "AT+WIFI"),
item(ITEM_WAVEPLAYBACK, "AT+RINGTONE"),
item(ITEM_SIGNALTEST, "AT+SIGNALTEST"),
item(ITEM_RTC, "AT+RTC"),
item(ITEM_CHARGER, "AT+CHARGER"),
item(ITEM_BT, "AT+BT"),
………………………………………………………………………………………………
#ifdef FEATURE_FTM_HDMI
item(ITEM_HDMI, "AT+HDMI"),
#endif
item(ITEM_MAX_IDS, NULL),
#if defined(MTK_SPEAKER_MONITOR_SUPPORT)
item(ITEM_SPEAKER_MONITOR_SET_TMP, "AT+SPKSETTMP"),
item(ITEM_SPEAKER_MONITOR, "AT+SPKMNTR"),
#endif
};
大师注释掉的at_command_processor->read_data_thread->at_command_parser->get_at_cmd_index
内比较的是
ftm_cmd_hdlr *at_cmd_hdlr = cmd_hdlr;
ftm_cmd_hdlr *other_at_cmd_hdlr = other_cmd_hdlr;
这两个数组分别如下:
static ftm_cmd_hdlr other_cmd_hdlr[]={
{0, ITEM_CUSTOM_START, "AT+START", (hdlr)dispatch_data_to_pc_cb},
{1, ITEM_CUSTOM_STOP, "AT+STOP", (hdlr)dispatch_data_to_pc_cb},
{2, ITEM_CUSTOM_REQUESTDATA, "AT+REQUESTDATA", (hdlr)ftm_request_data_cb},
{3, ITEM_CUSTOM_VERSION, "AT+VERSION", (hdlr)display_version},
#if 1
if(is_pc_control(usb_com_port))
{
pthread_create(&read_thread, NULL, read_data_thread_callback, NULL);
LOGD(TAG "after create pthread");
ata_status = 1;
pc_control_mode(usb_com_port);
LOGD(TAG "pc control stops in if()!\n");
ata_status = 0;
}
#else
//end add at order teset current
//for ata test
at_command_processor();
//add at order teset current
#endif
此处是田大师修改,ATA测试判定条件 is_pc_control,然后调用的查询函数,仅仅 用到如下一个数组,
故若是增加一个ATA测试项,仅需要在如下数组增加即可,相应逻辑请在 read_data_thread_callback下增加。
item_t pc_control_items[] =
{
item(ITEM_FM, "AT+FM"),
item(ITEM_MEMCARD, "AT+MEMCARD"),
item(ITEM_SIM, "AT+SIM"),
item(ITEM_GPS, "AT+GPS"),
item(ITEM_EMMC, "AT+EMMC"),
item(ITEM_WIFI, "AT+WIFI"),
item(ITEM_WAVEPLAYBACK, "AT+RINGTONE"),
item(ITEM_SIGNALTEST, "AT+SIGNALTEST"),
item(ITEM_RTC, "AT+RTC"),
item(ITEM_CHARGER, "AT+CHARGER"),
item(ITEM_BT, "AT+BT"),
………………………………………………………………………………………………
#ifdef FEATURE_FTM_HDMI
item(ITEM_HDMI, "AT+HDMI"),
#endif
item(ITEM_MAX_IDS, NULL),
#if defined(MTK_SPEAKER_MONITOR_SUPPORT)
item(ITEM_SPEAKER_MONITOR_SET_TMP, "AT+SPKSETTMP"),
item(ITEM_SPEAKER_MONITOR, "AT+SPKMNTR"),
#endif
};
大师注释掉的at_command_processor->read_data_thread->at_command_parser->get_at_cmd_index
内比较的是
ftm_cmd_hdlr *at_cmd_hdlr = cmd_hdlr;
ftm_cmd_hdlr *other_at_cmd_hdlr = other_cmd_hdlr;
这两个数组分别如下:
static ftm_cmd_hdlr other_cmd_hdlr[]={
{0, ITEM_CUSTOM_START, "AT+START", (hdlr)dispatch_data_to_pc_cb},
{1, ITEM_CUSTOM_STOP, "AT+STOP", (hdlr)dispatch_data_to_pc_cb},
{2, ITEM_CUSTOM_REQUESTDATA, "AT+REQUESTDATA", (hdlr)ftm_request_data_cb},
{3, ITEM_CUSTOM_VERSION, "AT+VERSION", (hdlr)display_version},