Esempio n. 1
0
File: Hid.cs Progetto: 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));
        }
Esempio n. 2
0
File: Hid.cs Progetto: 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));
        }