using System;
using System.Collections.Generic;
using System.Net.Mail;
using System.Text;

namespace InABox.DigitalMatter
{

    public class DMGuppyBluetoothTag : DMBluetoothTag
    {
        public uint SerialNumber { get; set; }

        public sbyte TxPower { get; set; }

        public byte BatteryVoltage { get; set; }

        public sbyte InternalTemperature { get; set; }

        public override string ID()
        {
            return SerialNumber.ToString();
        }

        public override string Type()
        {
            return "Guppy";
        }

        protected override void DoDecode()
        {
            SerialNumber = TakeUInt32();
            TxPower = TakeInt8();
            BatteryVoltage = TakeByte();
            InternalTemperature = TakeInt8();
        }

        protected override void DoEncode()
        {
            AddUInt32(SerialNumber);
            AddInt8(TxPower);
            AddByte(BatteryVoltage);
            AddInt8(InternalTemperature);
        }
    }
}
