using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RCUHost.Protocols;
using Common;
using System.IO;

namespace RCUHost.Implement
{
    public class CarbonVIP : GenericReceiverBase
    {
        private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(CarbonVIP));

        public override void Process(ReceiverContext context)
        {
            byte[] data = context.Data;

        }

        private byte[] CreateDataPacket(byte[] send_msg)
        {
            SystemHeader systemHeader = CreateSystemHeader();
            int size = StructConverter.SizeOf(systemHeader) + send_msg.Length + 2;
            systemHeader.FrameLength = (ushort)size;

            using (MemoryStream stream = new MemoryStream(size))
            {
                using (BinaryWriter writer = new BinaryWriter(stream))
                {
                    writer.Write(StructConverter.StructToBytes(systemHeader));
                    writer.Write(send_msg);
                    writer.Write(new byte[] { 0, 0 });
                    return stream.ToArray();
                }
            }
        }

        public override CommandType CommandType
        {
            get { return CommandType.SetRCULog; }
        }
    }
}
