Skip to content

Conversation

@eivindj-nordic
Copy link
Contributor

@eivindj-nordic eivindj-nordic commented Oct 28, 2025

No description provided.

@eivindj-nordic eivindj-nordic self-assigned this Oct 28, 2025
@eivindj-nordic eivindj-nordic requested review from a team as code owners October 28, 2025 09:48
@github-actions github-actions bot added changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. doc-required PR must not be merged without tech writer approval. labels Oct 28, 2025
@github-actions
Copy link

You can find the documentation preview for this PR here.

@eivindj-nordic eivindj-nordic force-pushed the error_handlers branch 3 times, most recently from 3a36230 to cfe69f7 Compare October 29, 2025 11:44
Copy link
Contributor

@lemrey lemrey left a 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,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra new line

Comment on lines 62 to 67
/**
* @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;
Copy link
Contributor

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.

Comment on lines 70 to 73
/**
* @brief Error event.
*/
BLE_NUS_EVT_ERROR,
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved last.

Comment on lines 127 to 131
/** @ref BLE_BAS_EVT_ERROR event data. */
struct {
/** Error reason. */
uint32_t reason;
} error;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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;
Copy link
Contributor

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.

Comment on lines 148 to 149
/** Connection handle. */
uint16_t conn_handle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move out?

@eivindj-nordic eivindj-nordic force-pushed the error_handlers branch 4 times, most recently from 73b576d to 342b13a Compare November 3, 2025 12:33
@lemrey lemrey added this to the v1.0.0 milestone Nov 5, 2025
if (nrf_err) {
LOG_ERR("pm_register() failed, nrf_error 0x%x", nrf_err);
return nrf_err;
}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@github-actions github-actions bot removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Nov 12, 2025
Comment on lines 127 to 131
/** @ref BLE_BAS_EVT_ERROR event data. */
struct {
/** Error reason. */
uint32_t reason;
} error;
Copy link
Contributor

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?

@eivindj-nordic
Copy link
Contributor Author

Do you need to update here?

Done.

@eivindj-nordic eivindj-nordic force-pushed the error_handlers branch 2 times, most recently from e6ab2d5 to c2396cc Compare November 17, 2025 11:09
@eivindj-nordic eivindj-nordic force-pushed the error_handlers branch 6 times, most recently from 0cbafcc to 9e0a309 Compare November 17, 2025 12:31
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]>
@eivindj-nordic eivindj-nordic merged commit 6e05db7 into nrfconnect:main Nov 19, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-required PR must not be merged without tech writer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants