Пример #1
0
        private void btnGetAppointtedDeviceInfo_Click(object sender, EventArgs e)
        {
            if (cbbDeviceIndex.SelectedIndex < 0)
            {
                LogDeviceInformation("Please select device Index first!");
                return;
            }
            TLIBHWInfo tmpDeviceInfo = new TLIBHWInfo(0);

            if (TsMasterApi.tsapp_get_hw_info_by_index(cbbDeviceIndex.SelectedIndex, ref tmpDeviceInfo) == 0)
            {
                LogDeviceInformation(tmpDeviceInfo.FDeviceInformation);
            }
        }
Пример #2
0
        private void btnGetAllHardwareInfos_Click(object sender, EventArgs e)
        {
            int        hardwareNum   = 0;
            TLIBHWInfo tmpDeviceInfo = new TLIBHWInfo(0);
            string     retMessage    = TsMasterApi.tsapp_get_error_description(TsMasterApi.tsapp_enumerate_hw_devices(out hardwareNum));

            if (retMessage == "OK")
            {
                LogDeviceInformation("Hardware Num:" + hardwareNum.ToString());
            }
            else
            {
                Log(retMessage);
                LogDeviceInformation("Enum hardware Info Failed!");
            }
            for (int i = 0; i < hardwareNum; i++)
            {
                if (TsMasterApi.tsapp_get_hw_info_by_index(i, ref tmpDeviceInfo) == 0)
                {
                    LogDeviceInformation(tmpDeviceInfo.FDeviceInformation);
                }
            }
        }