예제 #1
0
        public async Task ReadAdConfigAsync()
        {
            platform.customResponses.Add(new byte[] { 0x11, 0x81 },
                                         new byte[] { 0x11, 0x81, 0x4d, 0x65, 0x74, 0x61, 0x57, 0x65, 0x61, 0x72 });
            platform.customResponses.Add(new byte[] { 0x11, 0x82 },
                                         new byte[] { 0x11, 0x82, 0x9c, 0x02, 0x00, 0x00 });
            platform.customResponses.Add(new byte[] { 0x11, 0x87 },
                                         new byte[] { 0x11, 0x87, 0x19, 0xff, 0x6d, 0x62, 0x74, 0x68, 0x65, 0x20, 0x53, 0x63, 0x61, 0x72, 0x6c, 0x65, 0x74, 0x74, 0x20, 0x73 });

            var expected = new BleAdvertisementConfig("MetaWear", 417, 0,
                                                      new byte[] { 0x19, 0xff, 0x6d, 0x62, 0x74, 0x68, 0x65, 0x20, 0x53, 0x63, 0x61, 0x72, 0x6c, 0x65, 0x74, 0x74, 0x20, 0x73 });

            Assert.That(await settings.ReadBleAdConfigAsync(), Is.EqualTo(expected));
        }
예제 #2
0
            public override bool Equals(Object obj)
            {
                if (this == obj)
                {
                    return(true);
                }
                if (obj == null || GetType() != obj.GetType())
                {
                    return(false);
                }

                BleAdvertisementConfig config = obj as BleAdvertisementConfig;

                return(config.DeviceName.Equals(DeviceName) && config.ScanResponse.SequenceEqual(ScanResponse) &&
                       config.Interval == Interval && config.Timeout == Timeout);
            }