|
发表于 2008-8-13 17:16:09
|
显示全部楼层
给你个例子,里面要调用meta函数.详细的也不好讲清楚,希望对你有用...
int __declspec(dllexport) InitMetaMode(int* viSerial,char* comport,int nBBChipset)
{
METAAPP_RESULT error;
int bootstop;
META_Connect_Req META_connect_req;
META_Connect_Report META_connect_report;
memset(&META_connect_report, 0, sizeof(META_Connect_Report));
error = METAAPP_GetAvailableHandle(viSerial);
META_connect_req.com_port = atoi(comport);
META_connect_req.boot_meta_arg.m_bbchip_type = BBCHIP_TYPE(nBBChipset);
META_connect_req.boot_meta_arg.m_ext_clock = EXT_26M;
META_connect_req.baudrate[0] = META_BAUD115200;
META_connect_req.baudrate[1] = META_BAUD230400;
META_connect_req.baudrate[2] = META_BAUD460800;
META_connect_req.baudrate[3] = META_BAUD921600;
META_connect_req.baudrate[4] = META_BAUD_END;
META_connect_req.flowctrl = META_SW_FLOWCTRL;
META_connect_req.ms_connect_timeout = 30000;
META_connect_req.boot_meta_arg.m_ms_boot_timeout = 10000;
bootstop = 0;
error = METAAPP_ConnectWithTarget(*viSerial, &META_connect_req, &bootstop, &META_connect_report);
if(error)
return error;
error = METAAPP_Init(*viSerial);
return error;
} |
|