static IRSensitivity() { Level1 = new IRSensitivity(new byte[] { 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, 0x64, 0x00, 0xfe }, new byte[] { 0xfd, 0x05 }); Level2 = new IRSensitivity(new byte[] { 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, 0x96, 0x00, 0xb4 }, new byte[] { 0xb3, 0x04 }); Level3 = new IRSensitivity(new byte[] { 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, 0xaa, 0x00, 0x64 }, new byte[] { 0x63, 0x03 }); Level4 = new IRSensitivity(new byte[] { 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, 0xc8, 0x00, 0x36 }, new byte[] { 0x35, 0x03 }); Level5 = new IRSensitivity(new byte[] { 0x07, 0x00, 0x00, 0x71, 0x01, 0x00, 0x72, 0x00, 0x20 }, new byte[] { 0x1f, 0x03 }); Default = Level3; }
public void SetIRMode(IRMode irMode, IRSensitivity sensitivity) { bool enabled = (irMode != IRMode.Off); // Enable Pixel Clock. CreateReport(OutputReport.SetPixelClock); OutputBuffer[1] = (byte)(enabled ? 0x04 : 0x00); SendReport(); // Enable IR Logic. CreateReport(OutputReport.SetCamera); OutputBuffer[1] = (byte)(enabled ? 0x04 : 0x00); SendReport(); // No need to configure the camera when it is disabled. if (enabled) { // Configure the camera. WriteMemory(0x04b00030, 0x08); if (sensitivity != null) { // Set sensitivity configuration. WriteMemory(0x4b00000, sensitivity.ConfigurationBlock1); WriteMemory(0x4b0001a, sensitivity.ConfigurationBlock2); } // Set the ir-mode WriteMemory(0x04b00033, (byte)irMode); } _IrSensorEnabled = enabled; }