Exemple #1
0
 internal SirenOfShameInfo(UsbInfoPacket infoPacket)
 {
     FirmwareVersion    = infoPacket.FirmwareVersion;
     HardwareType       = infoPacket.HardwareType;
     HardwareVersion    = infoPacket.HardwareVersion;
     AudioMode          = infoPacket.AudioMode;
     AudioPlayDuration  = new TimeSpan(0, 0, 0, 0, infoPacket.AudioPlayDuration * 100);
     LedMode            = infoPacket.LedMode;
     LedPlayDuration    = new TimeSpan(0, 0, 0, 0, infoPacket.LedPlayDuration * 100);
     ExternalMemorySize = infoPacket.ExternalMemorySize;
 }
 internal SirenOfShameInfo(UsbInfoPacket infoPacket)
 {
     FirmwareVersion = infoPacket.FirmwareVersion;
     HardwareType = infoPacket.HardwareType;
     HardwareVersion = infoPacket.HardwareVersion;
     AudioMode = infoPacket.AudioMode;
     AudioPlayDuration = new TimeSpan(0, 0, 0, 0, infoPacket.AudioPlayDuration * 100);
     LedMode = infoPacket.LedMode;
     LedPlayDuration = new TimeSpan(0, 0, 0, 0, infoPacket.LedPlayDuration * 100);
     ExternalMemorySize = infoPacket.ExternalMemorySize;
 }
        public SirenOfShameInfo ReadDeviceInfo()
        {
            UsbInfoPacket infoPacket = new UsbInfoPacket
            {
                AudioMode          = (byte)_dlg.CurrentAudioPattern.Id,
                AudioPlayDuration  = (ushort)(_dlg.CurrentAudioDuration == null ? 0 : _dlg.CurrentAudioDuration.Value.TotalMilliseconds / 100),
                LedMode            = (byte)_dlg.CurrentLightPattern.Id,
                LedPlayDuration    = (ushort)(_dlg.CurrentLightDuration == null ? 0 : _dlg.CurrentLightDuration.Value.TotalMilliseconds / 100),
                ExternalMemorySize = 0,
                HardwareType       = HardwareType.Pro,
                FirmwareVersion    = 1
            };

            return(new SirenOfShameInfo(infoPacket));
        }
        public SirenOfShameInfo ReadDeviceInfo()
        {
            UsbInfoPacket infoPacket = _deviceInterfaceFile.GetInputReport <UsbInfoPacket>(ReportId_In_Info, PacketSize);

            _log.Debug("Info packet receieved:");
            _log.Debug("\tVersion: " + infoPacket.FirmwareVersion);
            _log.Debug("\tHardwareType: " + infoPacket.HardwareType);
            _log.Debug("\tHardwareVersion: " + infoPacket.HardwareVersion);
            _log.Debug("\tExternalMemorySize: " + infoPacket.ExternalMemorySize);
            _log.Debug("\tAudioMode: " + infoPacket.AudioMode);
            _log.Debug("\tAudioPlayDuration: " + infoPacket.AudioPlayDuration);
            _log.Debug("\tLedMode: " + infoPacket.LedMode);
            _log.Debug("\tLedPlayDuration: " + infoPacket.LedPlayDuration);
            FirmwareVersion = infoPacket.FirmwareVersion;
            HardwareType    = infoPacket.HardwareType;
            HardwareVersion = infoPacket.HardwareVersion;
            return(new SirenOfShameInfo(infoPacket));
        }
 public SirenOfShameInfo ReadDeviceInfo()
 {
     UsbInfoPacket infoPacket = new UsbInfoPacket
     {
         AudioMode = (byte)_dlg.CurrentAudioPattern.Id,
         AudioPlayDuration = (ushort)(_dlg.CurrentAudioDuration == null ? 0 : _dlg.CurrentAudioDuration.Value.TotalMilliseconds / 100),
         LedMode = (byte)_dlg.CurrentLightPattern.Id,
         LedPlayDuration = (ushort)(_dlg.CurrentLightDuration == null ? 0 : _dlg.CurrentLightDuration.Value.TotalMilliseconds / 100),
         ExternalMemorySize = 0,
         HardwareType = HardwareType.Pro,
         FirmwareVersion = 1
     };
     return new SirenOfShameInfo(infoPacket);
 }