示例#1
0
文件: Hid.cs 项目: mru00/hidapi
        public String GetManufacturerString()
        {
            AssertValidDev();
            byte[] buf = new byte[1000];
            int    ret = Hid.hid_get_manufacturer_string(dev, buf, (uint)(buf.Length / 4) - 1);

            if (ret < 0)
            {
                throw new Exception("failed to receive manufacturer string");
            }
            return(EncodeBuffer(buf));
        }
示例#2
0
文件: Hid.cs 项目: mru00/hidapi
        public string GetIndexedString(int index)
        {
            AssertValidDev();
            byte[] buf = new byte[1000];
            int    ret = Hid.hid_get_indexed_string(dev, index, buf, (uint)(buf.Length / 4) - 1);

            if (ret < 0)
            {
                throw new Exception("failed to receive indexed string");
            }
            return(EncodeBuffer(buf));
        }