Example #1
0
        public bool ShutdownRouteway485()
        {
            if (Serial485Handle < 0)
            throw new InvalidOperationException();

            bool Result = HCNetSDK.NET_DVR_SerialStop(Serial485Handle);

            if (Result)
            {
            Serial485Handle = -1;
            Serial485ReceiveHandle = null;
            Serial485DataHandle = null;
            }

            return Result;
        }
Example #2
0
        public bool EstablishRouteway485(SerialReceiveCallback SerialReceiveCall)
        {
            if (DvcUserID < 0 || Serial485Handle >= 0)
            throw new InvalidOperationException();

            Serial485DataHandle = new HCNetSDK.SerialDataCallBack(Serial485DataCall);

            Serial485Handle = HCNetSDK.NET_DVR_SerialStart(DvcUserID, 2, Serial485DataHandle, 0);

            Serial485ReceiveHandle = (Serial485Handle >= 0) ? SerialReceiveCall : null;

            return (Serial485Handle >= 0);
        }