Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }