-
Notifications
You must be signed in to change notification settings - Fork 29
library and services event handling and cleanup #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
library and services event handling and cleanup #447
Conversation
|
You can find the documentation preview for this PR here. |
3a36230 to
cfe69f7
Compare
lemrey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a brief look
| */ | ||
| BLE_BAS_EVT_NOTIFICATION_DISABLED | ||
| BLE_BAS_EVT_NOTIFICATION_DISABLED, | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra new line
| /** | ||
| * @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would keep the _ERROR event last in the enum everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure but currently there is no advantage for that. Do you have something in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing in particular with the use of the value, no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I am a bit unsure whether we should have it first then; typically I would expect it to be last..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved last.
| /** @ref BLE_BAS_EVT_ERROR event data. */ | ||
| struct { | ||
| /** Error reason. */ | ||
| uint32_t reason; | ||
| } error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would keep this last in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order kept the same as the events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to update here?
| uint16_t conn_handle; | ||
| /** Value to write */ | ||
| uint8_t value; | ||
| } led_write; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the conn_handle should be in the outermost structure here too.
include/bm/bluetooth/ble_gq.h
Outdated
| /** Connection handle. */ | ||
| uint16_t conn_handle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move out?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize that this is missing a return NRF_SUCCESS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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 <[email protected]>
* Formatting fixes to doxygen * Add error logging where error event is sent. This makes it easier to debug. Signed-off-by: Eivind Jølsgard <[email protected]>
* Formatting fixes to doxygen * Add error logging where error event is sent. This makes it easier to debug. Signed-off-by: Eivind Jølsgard <[email protected]>
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 <[email protected]>
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 <[email protected]>
* Add error logging where the error event is sent to the application. Signed-off-by: Eivind Jølsgard <[email protected]>
* 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 <[email protected]>
Align event handler for ble_gq with other libraries. Signed-off-by: Eivind Jølsgard <[email protected]>
Align error event at end of enum. Doxygen format fixes. Signed-off-by: Eivind Jølsgard <[email protected]>
31e0b3e to
d4331bd
Compare
No description provided.