public static IEnumerable <string> FindDevices(IntPtr hndl) { int devCount = HIDFT.EMyDetectDevice((long)hndl); return(Enumerable.Range(0, devCount) .Select(ii => String.Format("HID Device {0}", ii))); }
public IEnumerable <double> GetTempReadings() { lock (_lck) { double tmp = HIDFT.EMyReadTemp(true); yield return(tmp); } }
private void Initalize() { HIDFT.EMySetCurrentDev(_deviceId); Thread.Sleep(100); var ret = HIDFT.EMyInitConfig(true); if (!ret) { throw new InvalidOperationException("the type is not temper"); } byte[] upd = new byte[6]; HIDFT.EMyReadEP(ref upd[0], ref upd[1], ref upd[2], ref upd[3], ref upd[4], ref upd[5]); if (upd[1] != 0x58) { throw new InvalidOperationException("the type is not temper"); } _compensator = (upd[2] >= 10) & (upd[2] <= 0x1d) ? Convert.ToDouble(String.Format("{0}.{1}", upd[2], upd[3])) - 20.0 : 0.0; }
public void Dispose() { HIDFT.EMyCloseDevice(); }