Skip to content

Commit

Permalink
Rename rc to return code for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiori committed Jul 6, 2018
1 parent b9b2478 commit 6bf989f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public void onResponse(@NonNull final McuMgrImageStateResponse response) {

// Check for an error return code
if (!response.isSuccess()) {
fail(new McuMgrErrorException(response.getRc()));
fail(new McuMgrErrorException(response.getReturnCode()));
return;
}

Expand Down Expand Up @@ -432,7 +432,7 @@ public void onResponse(@NonNull McuMgrImageStateResponse response) {
Log.v(TAG, "Test response: " + response.toString());
// Check for an error return code
if (!response.isSuccess()) {
fail(new McuMgrErrorException(response.getRc()));
fail(new McuMgrErrorException(response.getReturnCode()));
return;
}
if (response.images.length != 2) {
Expand Down Expand Up @@ -495,7 +495,7 @@ public void onResponse(@NonNull McuMgrResponse response) {
Log.v(TAG, "Reset request sent. Waiting for reset");
// Check for an error return code
if (!response.isSuccess()) {
fail(new McuMgrErrorException(response.getRc()));
fail(new McuMgrErrorException(response.getReturnCode()));
}
}

Expand All @@ -516,7 +516,7 @@ public void onResponse(@NonNull McuMgrImageStateResponse response) {
Log.v(TAG, "Confirm response: " + response.toString());
// Check for an error return code
if (!response.isSuccess()) {
fail(new McuMgrErrorException(response.getRc()));
fail(new McuMgrErrorException(response.getReturnCode()));
return;
}
if (response.images.length == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class McuMgrResponse {
/**
* The return code (enum) for this response. For the raw return code use the "rc" property.
*/
private McuMgrErrorCode mRc;
private McuMgrErrorCode mReturnCode;

/**
* McuMgr payload for this response. This does not include the McuMgr header for standard
Expand Down Expand Up @@ -91,12 +91,12 @@ public McuMgrHeader getHeader() {
*
* @return Mcu Manager return code.
*/
public int getRcValue() {
if (mRc == null) {
public int getReturnCodeValue() {
if (mReturnCode == null) {
Log.w(TAG, "Response does not contain a McuMgr return code.");
return 0;
} else {
return mRc.value();
return mReturnCode.value();
}
}

Expand All @@ -105,8 +105,8 @@ public int getRcValue() {
*
* @return The return code enum.
*/
public McuMgrErrorCode getRc() {
return mRc;
public McuMgrErrorCode getReturnCode() {
return mReturnCode;
}

/**
Expand Down Expand Up @@ -187,7 +187,7 @@ void initFields(McuMgrScheme scheme, byte[] bytes, McuMgrHeader header, byte[] p
mBytes = bytes;
mHeader = header;
mPayload = payload;
mRc = rc;
mReturnCode = rc;
}

/**
Expand Down

0 comments on commit 6bf989f

Please sign in to comment.