示例#1
0
 public BLEManufacturerData(BLEPacketType packetType, byte[] data)
     : base(packetType)
 {
     CompanyId = BitConverter.ToUInt16(data, 0);
     Data      = new byte[data.Length - 2];
     Buffer.BlockCopy(data, 2, Data, 0, Data.Length);
 }
        public BLEAdvertisementDataSection(BLEPacketType packetType, byte[] data)
            : base(packetType)
        {
            Manufacturer = BitConverter.ToUInt16(data, 0);
            Data         = new byte[data.Length];
            Buffer.BlockCopy(data, 0, Data, 0, Data.Length);

            // TODO:
            // it's unclear to me where this comes from
            // The WIndows API sets it for Eddystone packets, but I can't find it in any documentation
            //DataType = 0x16;
        }
示例#3
0
 public BLENameRecord(BLEPacketType packetType, byte[] data)
     : base(packetType)
 {
     Name = Encoding.ASCII.GetString(data);
 }
示例#4
0
 public BLEGenericRecord(BLEPacketType packetType, byte[] data)
     : base(packetType)
 {
     RawData = data;
 }
示例#5
0
 protected BLERecord(BLEPacketType packetType)
 {
     PacketType = packetType;
 }
示例#6
0
 public BLEFlagRecord(BLEPacketType packetType, byte flags)
     : base(packetType)
 {
     Flags = flags;
 }