You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.0 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
namespace FBeeService
{
public static class CommandHelper
{
//public static byte[] Create(byte type, byte[] payload)
//{
// var list = new List<byte> { 0xfe, 0xa5, type };
// list.AddRange(payload);
// list.Add((byte)list.Skip(2).Select(o => Convert.ToInt32(o)).Sum());
// return list.ToArray();
//}
//public static byte[] CreateCommand(byte[] payload)
//{
// return Create(0x01, payload);
//}
//public static byte[] CreateAddressCommand()
//{
// return CreateCommand(new byte[] { 0x0c });
//}
//public static byte[] Execute(this NetworkStream stream, byte[] command)
//{
// stream.Write(command);
// var buffer = new byte[256];
// var length = stream.Read(buffer);
// return buffer.Take(length).ToArray();
//}
}
}