コード例 #1
0
ファイル: IotRequest.cs プロジェクト: ym1100/AceSaaS
        private IotRequest(IotReceiveFilter filter)
        {
            this.filter = filter;

            HeaderHex = filter.Header;
            Header    = EncodingHelper.HexToBytes(HeaderHex);
        }
コード例 #2
0
        public IReceiveFilter <IotRequest> CreateFilter(IAppServer appServer, IAppSession appSession, IPEndPoint remoteEndPoint)
        {
            var opts   = appServer.Config.Options;
            var filter = new IotReceiveFilter(opts["header"], Convert.ToInt32(opts["cryptoKey"], 16));

            appSession.Items["filter"] = filter;

            return(filter);
        }
コード例 #3
0
ファイル: IotRequest.cs プロジェクト: ym1100/AceSaaS
        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);
        }
コード例 #4
0
ファイル: IotRequest.cs プロジェクト: ym1100/AceSaaS
        public IotRequest(IotReceiveFilter filter, byte[] body) : this(filter)
        {
            EncryptedBody = body;

            LoadData();
        }