-
Notifications
You must be signed in to change notification settings - Fork 31
services: add ble_bms #280
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
Conversation
e20c85f to
4d718f8
Compare
|
You can find the documentation preview for this PR here. |
4d718f8 to
92c4e79
Compare
92c4e79 to
9076412
Compare
9076412 to
8869608
Compare
0dd951c to
8a689af
Compare
8a689af to
96bc75e
Compare
96bc75e to
b201c25
Compare
| Events from the service are forwarded through the event handler specified during initialization. | ||
| For a full list of events see the :c:enum:`ble_bms_evt_type` enum. | ||
|
|
||
|
|
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 newline.
| | Header file: :file:`include/bluetooth/services/ble_bms.h` | ||
| | Source files: :file:`subsys/bluetooth/services/ble_bms/` | ||
|
|
||
| :ref:`Battery Service API reference <api_ble_bms>` |
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.
| :ref:`Battery Service API reference <api_ble_bms>` | |
| :ref:`Bond Management Service API reference <api_ble_bms>` |
samples/bluetooth/ble_bms/Kconfig
Outdated
| default 512 | ||
|
|
||
| config BLE_BMS_PEERS_TO_DELETE_ON_DISCONNECT_MAX | ||
| int "Maximum nmber of peers to delete pending peer disconnect" |
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.
| int "Maximum nmber of peers to delete pending peer disconnect" | |
| int "Maximum number of peers to delete pending peer disconnect" |
| } | ||
| } | ||
|
|
||
|
|
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 newline.
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.
Thanks, comments addressed.
b201c25 to
552f994
Compare
|
|
||
| /** @brief BMS event types. */ | ||
| enum ble_bms_evt_type { | ||
|
|
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.
| * authorization code is not valid. | ||
| */ | ||
| uint16_t ble_bms_on_qwr_evt(struct ble_bms *bms, struct ble_qwr *qwr, | ||
| const struct ble_qwr_evt *evt); |
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.
bad alignment
| cmake_minimum_required(VERSION 3.20.0) | ||
|
|
||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
| project(ble_lbs) |
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.
wrong name
samples/bluetooth/ble_bms/Kconfig
Outdated
| default 10 | ||
|
|
||
| module=BLE_BMS_SAMPLE | ||
| module-dep=LOG |
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.
| module-dep=LOG |
let's not keep re-adding this thing that has never done anything
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.
Thanks!
samples/bluetooth/ble_bms/src/main.c
Outdated
| LOG_ERR("Failed to delete peer, nrf_error %#x", 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.
samples/bluetooth/ble_bms/src/main.c
Outdated
| goto idle; | ||
| } | ||
|
|
||
| const bool erase_bonds = bm_buttons_is_pressed(BOARD_PIN_BTN_1); |
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.
declare variables at top of scope
| default "ABCD" | ||
|
|
||
| module=BLE_BMS | ||
| module-dep=LOG |
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.
| module-dep=LOG |
samples/bluetooth/ble_bms/Kconfig
Outdated
|
|
||
| menu "BLE BMS sample" | ||
|
|
||
| config QWR_MEM_BUFF_SIZE |
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.
prefix application/sample Kconfigs with APP_ so that they won't possibly conflict with future Kconfigs added to subsystems
samples/bluetooth/ble_bms/Kconfig
Outdated
| default 512 | ||
|
|
||
| config BLE_BMS_PEERS_TO_DELETE_ON_DISCONNECT_MAX | ||
| int "Maximum number of peers to delete pending peer disconnect" |
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.
not clear to me what this does
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.
| int "Maximum number of peers to delete pending peer disconnect" | |
| int "Maximum number of peers to delete upon a peer disconnect" |
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.
Rewritten as suggested by @MirkoCovizzi.
552f994 to
7d86a9e
Compare
samples/bluetooth/ble_bms/src/main.c
Outdated
| break; | ||
|
|
||
| case BLE_GAP_EVT_DISCONNECTED: | ||
| LOG_INF("Peer disconnected, reason %d", |
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.
As far as I can see, these values (BLE_HCI_STATUS_CODES) are defined as hex.
| LOG_INF("Peer disconnected, reason %d", | |
| LOG_INF("Peer disconnected, reason %#x", |
peknis
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.
Just wondering about the capitalization. Server or server?
| Deleting the bonds | ||
| ================== | ||
|
|
||
| The Server deletes bonding information on client's request right away when there is no active Bluetooth® Low Energy connection associated with a bond. |
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 we need to capitalize the Server?
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 don't think it should be capitalized. In fact, the counterpart client is not, in the same sentence.
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.
This was capitalized in nRF5 documentation, though I agree it is not needed.
52d0aac to
78af194
Compare
| int "Softdevice event observer priority" | ||
| default 0 | ||
|
|
||
| config USE_AUTHORIZATION_CODE |
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.
add prefix to these, "use authorization code" has no context, e.g. BLE_BMS_USE_AUTHORIZATION_CODE, fix in whole PR
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.
Thanks, updated.
78af194 to
ec67795
Compare
| bool "Use authorization code" | ||
| default y | ||
|
|
||
| config AUTHORIZATION_CODE |
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.
missed the update?
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 seems so, updated now...
ec67795 to
61448a9
Compare
MechanicV1
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.
Approving for tests !
446c21a to
e693175
Compare
Add bond management service. Signed-off-by: Eivind Jølsgard <[email protected]>
e693175 to
f184255
Compare
|
doc-postponed: missing changelog entries. |
|
Release notes changelog added in #557. |

Add bond management service.