ble_initializeSecurity: minor inversion of error checking code.

This commit is contained in:
Rohit Grover 2015-04-27 08:57:51 +01:00
parent 509325724e
commit 002f61cf83

View file

@ -56,18 +56,18 @@ btle_initializeSecurity()
};
ret_code_t rc;
if ((rc = dm_register(&applicationInstance, &dm_param)) == NRF_SUCCESS) {
return BLE_ERROR_NONE;
if ((rc = dm_register(&applicationInstance, &dm_param)) != NRF_SUCCESS) {
switch (rc) {
case NRF_ERROR_INVALID_STATE:
return BLE_ERROR_INVALID_STATE;
case NRF_ERROR_NO_MEM:
return BLE_ERROR_NO_MEM;
default:
return BLE_ERROR_UNSPECIFIED;
}
}
switch (rc) {
case NRF_ERROR_INVALID_STATE:
return BLE_ERROR_INVALID_STATE;
case NRF_ERROR_NO_MEM:
return BLE_ERROR_NO_MEM;
default:
return BLE_ERROR_UNSPECIFIED;
}
return BLE_ERROR_NONE;
}
ble_error_t