public IotRequest CreateRequest(string command, string dataHex = "") { var request = new IotRequest(filter); request.SessionId = SessionId; request.Device = Device; request.Command = new IotCommand(command, dataHex); request.Key = request.Command.Key; request.Length = request.Command.Data.Length + 24; return(request); }
public IotRequest CreateResponse(string dataHex) { var request = new IotRequest(filter); request.SessionId = SessionId; request.Device = Device; request.Command = Command.MakeBack(dataHex); request.Key = request.Command.Key; request.Length = request.Command.Data.Length + 12; return(request); }
public static IotRequest CreateRequest(IotReceiveFilter filter, string mac, string command, string dataHex = "") { var request = new IotRequest(filter); request.Device = IotDevice.Load(mac); request.SessionId = request.Device.Mac.Right(4); request.Command = new IotCommand(command, dataHex); request.Key = request.Command.Key; request.Length = request.Command.Data.Length + 12; return(request); }