Exemplo n.º 1
0
        /// <summary>
        /// 查询连接存储设备
        /// </summary>
        /// <returns></returns>
        public bool Connected()
        {
            int device_num = 0;
            int ret        = SDKApi.EagleControl_ScanAndGetDeviceNum(ref device_num);

            if (ret == 0)
            {
                if (device_num > 0)
                {
                    IntPtr[] device_ids = new IntPtr[device_num];
                    int      ids        = 0;
                    ret = SDKApi.EagleControl_GetDeviceIds(device_ids, 1, ref ids);
                    if (ret == 0)
                    {
                        var initdevice = SDKApi.EagleData_Init();//初始化设备
                        DeviceId    = (int)device_ids[0];
                        IsConnected = true;
                        return(true);
                    }
                }
            }

            return(false);
        }