Example #1
0
        public unsafe ISensorModeState GetInitialModeState()
        {
            WorkSpace workSpace = TcpCommand.GetWorkSpace(typeof(RequestForGetInitialModeState));
            RequestForGetInitialModeState *address = (RequestForGetInitialModeState *)(void *)workSpace.Address;

            address->header.wCommHeaderId   = (ushort)4427;
            address->header.byCommandKind   = (byte)4;
            address->header.lBodyLength     = 0;
            address->header.uOption0.dwCode = 0U;
            this.SendRequest(workSpace);
            TcpCommand.ReleaseWorkSpace(workSpace);
            WorkSpace       fixedLengthReply = this.ReceiveFixedLengthReply(typeof(ReplyForGetInitialModeState));
            SensorModeState sensorModeState  = new SensorModeState((ReplyForGetInitialModeState *)(void *)fixedLengthReply.Address);

            TcpCommand.ReleaseReceiveBuffer(fixedLengthReply);
            return((ISensorModeState)sensorModeState);
        }
Example #2
0
        public unsafe ISensorModeState SetStateTransition(ISensorModeState newState)
        {
            WorkSpace workSpace = TcpCommand.GetWorkSpace(typeof(RequestForSetStateTransition));
            RequestForSetStateTransition *address = (RequestForSetStateTransition *)(void *)workSpace.Address;

            address->header.wCommHeaderId       = (ushort)4427;
            address->header.byCommandKind       = (byte)6;
            address->header.lBodyLength         = 0;
            address->header.uOption0.abyCode[0] = (byte)newState.VisionSensorStateEnum;
            address->header.uOption0.abyCode[1] = (byte)newState.VisionSensorMode;
            address->header.uOption0.awCode[1]  = (ushort)0;
            this.SendRequest(workSpace);
            TcpCommand.ReleaseWorkSpace(workSpace);
            WorkSpace       fixedLengthReply = this.ReceiveFixedLengthReply(typeof(ReplyForSetStateTransition));
            SensorModeState sensorModeState  = new SensorModeState((ReplyForSetStateTransition *)(void *)fixedLengthReply.Address);

            TcpCommand.ReleaseReceiveBuffer(fixedLengthReply);
            return((ISensorModeState)sensorModeState);
        }