/** report any comm/CAN errors if any occur */
 private void HandleErr(int status)
 {
     if (status != 0)
     {
         Reporting.SetError(status, Reporting.getHALErrorMessage(status));
     }
 }
 public ErrorCode SetLastError(ErrorCode errorCode)
 {
     if (errorCode != ErrorCode.OK)
     {
         Reporting.SetError((int)errorCode, Reporting.getHALErrorMessage((int)errorCode));
     }
     /* mirror last status */
     LastError = errorCode;
     return(LastError);
 }
        public bool GetAppliedSolenoidOutput(int idx, out bool enable)
        {
            int status = m_impl.GetSol(idx, out enable);

            if (status != 0)
            {
                Reporting.SetError(status, Reporting.getHALErrorMessage(status));
            }
            return(enable);
        }
Esempio n. 4
0
 private int HandleError(int errorCode)
 {
     /* error handler */
     if (errorCode != 0)
     {
         Reporting.SetError(errorCode, Reporting.getHALErrorMessage(errorCode));
     }
     /* mirror last status */
     _lastError = errorCode;
     return(_lastError);
 }
        public void SetSolenoidOutput(int idx, bool enable)
        {
            int status = m_impl.SetEnableSol(idx, enable);

            if (status == 0)
            {
                /* save the value so caller can check what the target output is */
                _solen[idx] = enable;
            }
            else
            {
                Reporting.SetError(status, Reporting.getHALErrorMessage(status));
            }
        }