library and services event handling and cleanup#447
Conversation
|
You can find the documentation preview for this PR here. |
3a36230 to
cfe69f7
Compare
| */ | ||
| BLE_BAS_EVT_NOTIFICATION_DISABLED | ||
| BLE_BAS_EVT_NOTIFICATION_DISABLED, | ||
|
|
| /** | ||
| * @brief Connection handle for which the event applies. | ||
| * | ||
| * Used for BLE_BAS_EVT_NOTIFICATION_ENABLED and BLE_BAS_EVT_NOTIFICATION_DISABLED. | ||
| */ | ||
| uint16_t conn_handle; |
There was a problem hiding this comment.
The conn_handle should be part of the outermost structure, because otherwise it's impossible to know which peer any message belongs to.
| /** | ||
| * @brief Error event. | ||
| */ | ||
| BLE_NUS_EVT_ERROR, |
There was a problem hiding this comment.
nit: I would keep the _ERROR event last in the enum everywhere.
There was a problem hiding this comment.
It is the first everywhere so that it has the same value for all libraries and services. Having it at the end will give different values, and it will change if another event is added.
There was a problem hiding this comment.
Sure but currently there is no advantage for that. Do you have something in mind?
There was a problem hiding this comment.
Nothing in particular with the use of the value, no.
There was a problem hiding this comment.
ok, I am a bit unsure whether we should have it first then; typically I would expect it to be last..
| /** @ref BLE_BAS_EVT_ERROR event data. */ | ||
| struct { | ||
| /** Error reason. */ | ||
| uint32_t reason; | ||
| } error; |
There was a problem hiding this comment.
nit: I would keep this last in the list.
There was a problem hiding this comment.
Order kept the same as the events.
There was a problem hiding this comment.
Do you need to update here?
| @@ -55,6 +62,11 @@ struct ble_lbs_evt { | |||
| /** Value to write */ | |||
| uint8_t value; | |||
| } led_write; | |||
There was a problem hiding this comment.
I think the conn_handle should be in the outermost structure here too.
| /** Connection handle. */ | ||
| uint16_t conn_handle; |
73b576d to
342b13a
Compare
| if (nrf_err) { | ||
| LOG_ERR("pm_register() failed, nrf_error 0x%x", nrf_err); | ||
| return nrf_err; | ||
| } |
There was a problem hiding this comment.
I realize that this is missing a return NRF_SUCCESS.
There was a problem hiding this comment.
Added in #437, where the file is changed.
342b13a to
16cf730
Compare
16cf730 to
d64c37b
Compare
| /** @ref BLE_BAS_EVT_ERROR event data. */ | ||
| struct { | ||
| /** Error reason. */ | ||
| uint32_t reason; | ||
| } error; |
There was a problem hiding this comment.
Do you need to update here?
d64c37b to
b0babb9
Compare
Done. |
e6ab2d5 to
c2396cc
Compare
0cbafcc to
9e0a309
Compare
9e0a309 to
221a91e
Compare
221a91e to
31e0b3e
Compare
Add error event to NUS service. Align event handler with other services. Align event type field name to evt_type. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
Add error event to BAS service. The event is currently unused, but is added to align with other services. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
* Formatting fixes to doxygen * Add error logging where error event is sent. This makes it easier to debug. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
* Formatting fixes to doxygen * Add error logging where error event is sent. This makes it easier to debug. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
Add error event to HRS service. The event is currently unused, but is added to align with other services. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
Add error event to LBS service. The event is currently unused, but is added to align with other services. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
* Add error logging where the error event is sent to the application. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
* Add error event to ble_conn_params library. * Change conn_params_event id field to evt_type to align with other. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
Align event handler for ble_gq with other libraries. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
Align error event at end of enum. Doxygen format fixes. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
31e0b3e to
d4331bd
Compare
No description provided.