Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fun"></param>
        /// <param name="datas"></param>
        protected override void ProcessData(byte fun, Cheetah.ByteBuffer datas)
        {
            if (fun == ApiFunConst.RealDataPushFun)
            {
                ProcessDataPush?.Invoke(datas);
            }
            else if (fun == ApiFunConst.AysncReturn)
            {
                //收到异步请求回调数据
                return;
            }
            else
            {
                //datas.IncRef();
                switch (fun)
                {
                case ApiFunConst.TagInfoRequest:
                    mInfoRequreData?.UnlockAndReturn();
                    mInfoRequreData = datas;
                    infoRequreEvent.Set();
                    break;

                case ApiFunConst.RealDataRequestFun:
                    mRealRequreData?.UnlockAndReturn();
                    mRealRequreData = datas;
                    this.realRequreEvent.Set();
                    break;

                case ApiFunConst.RealDataSetFun:
                    mRealSetResponseData?.UnlockAndReturn();
                    mRealSetResponseData = datas;
                    this.realSetRequreEvent.Set();
                    break;

                case ApiFunConst.HisDataRequestFun:
                    //mHisRequreData?.UnlockAndReturn();
                    //mHisRequreData = datas;

                    var cid = datas.ReadInt();
                    ProcessHisDataCallBack(cid, datas);
                    //hisRequreEvent.Set();
                    break;

                case ApiFunConst.SyncRealTagConfig:
                    mRealSyncData?.UnlockAndReturn();
                    mRealSyncData = datas;
                    SyncDataEvent.Set();
                    break;

                case ApiFunConst.SyncSecuritySetting:
                    mRealSyncData?.UnlockAndReturn();
                    mRealSyncData = datas;
                    SyncDataEvent.Set();
                    break;

                case ApiFunConst.SyncHisTagConfig:
                    mRealSyncData?.UnlockAndReturn();
                    mRealSyncData = datas;
                    SyncDataEvent.Set();
                    break;

                case ApiFunConst.TagInfoNotify:
                    ProcessTagInfoNotify(datas);
                    break;

                default:
                    Debug.Print("DbClient ProcessData Invailed data");
                    break;
                }
            }
        }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="fun"></param>
 /// <param name="datas"></param>
 protected virtual void ProcessData(byte fun, Cheetah.ByteBuffer datas)
 {
 }