Beispiel #1
0
        public override COMMUNICATERESULT SetData(CommandClass SetInfo)
        {
            int BytestoRec = 8;

            byte[]            RecBytes;
            byte[]            SendCommand;
            COMMUNICATERESULT ret;

            SendCommand = SetInfo.Command;
            if (!USBWrapper.USBConnectState())
            {
                if (USBWrapper.connect() == COMMUNICATERESULT.OK)
                {
                    ret = USBWrapper.SendAndReceive(SendCommand, BytestoRec, out RecBytes);
                }
                else
                {
                    return(COMMUNICATERESULT.PortOpenFail);
                }
            }
            else
            {
                ret = USBWrapper.SendAndReceive(SendCommand, BytestoRec, out RecBytes);
            }
            if (ret == COMMUNICATERESULT.OK)
            {
                ret = CheckData(RecBytes, SendCommand);
            }

            return(ret);
        }
Beispiel #2
0
 public override bool ConnectState()
 {
     return(USBWrapper.USBConnectState());
 }