simplify some error handling.

This commit is contained in:
Rohit Grover 2015-04-22 13:18:25 +01:00
parent 560d7d3de9
commit 85fcb2cbb3

View file

@ -56,17 +56,25 @@ btle_initializeSecurity()
};
ret_code_t rc;
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;
}
if ((rc = dm_register(&applicationInstance, &dm_param)) == NRF_SUCCESS) {
return BLE_ERROR_NONE;
}
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;
}
}
ble_error_t
btle_deleteAllStoredDevices(void)
{
ret_code_t rc;
return BLE_ERROR_NONE;
}