No changes
Fork of nRF51822 by
Diff: btle/btle_security.cpp
- Revision:
- 143:9d73e7f9f2bf
- Parent:
- 142:b6fe43a5c18f
- Child:
- 144:9d8fce4b4d5a
diff -r b6fe43a5c18f -r 9d73e7f9f2bf btle/btle_security.cpp --- a/btle/btle_security.cpp Fri May 08 15:33:57 2015 +0100 +++ b/btle/btle_security.cpp Fri May 08 15:33:57 2015 +0100 @@ -56,18 +56,18 @@ }; 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