public SDK() { InitializeComponent(); dtRecord.Columns.Add("deviceID"); dtRecord.Columns.Add("onlineFlag"); dtRecord.Columns.Add("recordTime"); dtRecord.Columns.Add("recordType"); dtRecord.Columns.Add("credenceType"); dtRecord.Columns.Add("userID"); dtRecord.Columns.Add("userType"); dtRecord.Columns.Add("picture"); dtRecord.Columns.Add("gateOpenMode"); dtRecord.Columns.Add("credenceNo"); dtRecord.Columns.Add("recCarNOColor"); dtRecord.Columns.Add("carLogo"); dtRecord.Columns.Add("carType"); dtRecord.Columns.Add("deviceEntryType"); dgvRecord.DataSource = dtRecord.DefaultView; dtEventRecord.Columns.Add("subDviceID"); dtEventRecord.Columns.Add("eventType"); dtEventRecord.Columns.Add("address"); dtEventRecord.Columns.Add("time"); dtEventRecord.Columns.Add("description"); dtEventRecord.Columns.Add("picID"); dgvEventRecord.DataSource = dtEventRecord.DefaultView; GloablInfo.sdk = this; m_SmartDevice_CallBack = mySmartDevice_CallBack; SmartDeviceInterface.SmartDevice_SetCallBack(m_SmartDevice_CallBack); unsafe { m_SmartDeviceNeedResponse_CallBack = mySmartDeviceNeedResponse_CallBack; } SmartDeviceInterface.SmartDevice_SetNeedResponseCallBack(m_SmartDeviceNeedResponse_CallBack); m_SmartDeviceOffline_CallBack = mySmartDeviceOffline_CallBack; SmartDeviceInterface.SmartDevice_SetOfflineCallBack(m_SmartDeviceOffline_CallBack); //设计命令超时1000毫秒 SmartDeviceInterface.SmartDevice_SetTimeOut(1000); //智能设备SDK初始化 SmartDeviceInterface.SmartDevice_Init(20001, 0); }
/// <summary> /// 智能设备SDK设置需回应回调函数 /// COM_DEV_REGISTER_JS 设备注册 /// </summary> public void SmartDevice_SetNeedResponseCallBack(SmartDeviceNeedResponse_CallBack callback) { SmartDeviceInterface.SmartDevice_SetNeedResponseCallBack(callback); }