Beispiel #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;
        }
Beispiel #3
0
 public BLENameRecord(BLEPacketType packetType, byte[] data)
     : base(packetType)
 {
     Name = Encoding.ASCII.GetString(data);
 }
Beispiel #4
0
 public BLEGenericRecord(BLEPacketType packetType, byte[] data)
     : base(packetType)
 {
     RawData = data;
 }
Beispiel #5
0
 protected BLERecord(BLEPacketType packetType)
 {
     PacketType = packetType;
 }
Beispiel #6
0
 public BLEFlagRecord(BLEPacketType packetType, byte flags)
     : base(packetType)
 {
     Flags = flags;
 }