Skip to content

Commit

Permalink
add isSuccessful method to McuMgrResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiori committed May 15, 2018
1 parent cd8fe03 commit 1fccb3d
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ public McuMgrErrorCode getRc() {
return mRc;
}

/**
* Returns true if the response payload contains a return code of 0 or no return code. In other
* words, return true if the command was a success, false otherwise.
* @return return true if the command was a success, false otherwise
*/
public boolean isSuccess() {
return rc == McuMgrErrorCode.OK.value();
}

/**
* Get the response bytes.
* <p>
Expand All @@ -122,10 +131,7 @@ public byte[] getBytes() {
}

/**
* Get the response payload in bytes.
* <p>
* If using a CoAP scheme this method and {@link McuMgrResponse#getPayload()} will return the
* same value.
* Get the response payload bytes.
*
* @return the payload bytes
*/
Expand Down

0 comments on commit 1fccb3d

Please sign in to comment.