Ejemplo n.º 1
0
 private Device(PresenceResponseMessage message)
 {
     Address     = message.Origin.Address;
     Flags       = message.Flags;
     DeviceType  = message.DeviceType;
     Name        = message.Name;
     HardwareId  = message.HardwareId;
     Certificate = message.Certificate;
 }
Ejemplo n.º 2
0
        internal Device(PresenceResponseMessage message)
        {
            Address     = message.Origin.Address;
            Flags       = message.Flags;
            DeviceType  = message.DeviceType;
            Name        = message.Name;
            HardwareId  = message.HardwareId;
            Certificate = message.Certificate;
            LiveId      = message.Certificate.GetLiveId();

            State = DeviceState.Available;
        }
Ejemplo n.º 3
0
        public DeviceTests()
        {
            byte[] cert     = ResourcesProvider.GetBytes("selfsigned_cert.bin", ResourceType.Misc);
            byte[] msgBytes = ResourcesProvider.GetBytes("presence_response.bin", ResourceType.SmartGlass);
            var    x509     = CryptoExtensions.DeserializeCertificateAsn(cert);

            _presenceResponse = new PresenceResponseMessage();
            using (EndianReader er = new EndianReader(msgBytes))
            {
                _presenceResponse.Deserialize(er);
            }
            _presenceResponse.Origin = new IPEndPoint(IPAddress.Parse("192.168.1.2"), 5234);

            _deviceManual = new Device(
                DeviceType.XboxOne,
                IPAddress.Parse("192.168.1.3"),
                "XboxOne",
                "FD0123456789",
                new Guid("de305d54-75b4-431b-adb2-eb6b9e546014")
                );

            _deviceFromResponse = new Device(_presenceResponse);
        }