private bool CheckResponse(Packet response) { APStatus BM_errorstate = (APStatus)response.Data[Constants.PACKET_BYTE_CMD]; if (BM_errorstate != APStatus.HW_NO_ERROR) { return(false); } return(true); }
/// <summary> /// Get generic hardware status /// </summary> /// <param name="status"> /// Returns one of the following values: /// HW_IDLE, HW_SIMPLICITI_STOPPED, HW_SIMPLICITI_TRYING_TO_LINK, HW_SIMPLICITI_LINKED, /// HW_BLUEROBIN_STOPPED, HW_BLUEROBIN_TRANSMITTING, HW_ERROR, HW_NO_ERROR, HW_NOT_CONNECTED /// </param> /// <returns>true, if the command succeeded</returns> public bool GetAPStatus(out APStatus status) { byte[] data = new byte[1] { 0x00 }; Packet response = SendAndReceive(Packet.Create(APCommand.BM_GET_STATUS, data), data.Length, 1); status = (APStatus)response.Data[Constants.PACKET_DATA_START]; return(CheckResponse(response)); }
/// <summary> /// Get generic hardware status /// </summary> /// <param name="status"> /// Returns one of the following values: /// HW_IDLE, HW_SIMPLICITI_STOPPED, HW_SIMPLICITI_TRYING_TO_LINK, HW_SIMPLICITI_LINKED, /// HW_BLUEROBIN_STOPPED, HW_BLUEROBIN_TRANSMITTING, HW_ERROR, HW_NO_ERROR, HW_NOT_CONNECTED /// </param> /// <returns></returns> public bool GetAPStatus(out APStatus status) { byte[] data = new byte[1] { 0x00 }; Packet response = SendAndReceive(Packet.Create(APCommand.BM_GET_STATUS, data), data.Length, 1); status = (APStatus)response.Data[Constants.PACKET_DATA_START]; return CheckResponse(response); }