-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
bluetooth: services: ras: Add initial folder structure for ranging service #18503
base: main
Are you sure you want to change the base?
bluetooth: services: ras: Add initial folder structure for ranging service #18503
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 76d2287b0635dfe0fa34748d5ad344a7f83c29f1 more detailssdk-nrf:
Github labels
List of changed files detected by CI (11)
Outputs:ToolchainVersion: b44b7a08c9 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
0aab5d1
to
1459343
Compare
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
include/bluetooth/services/ras.h
Outdated
#define BT_UUID_RAS_RD_READY BT_UUID_DECLARE_16(BT_UUID_RAS_RD_READY_VAL) | ||
#define BT_UUID_RAS_RD_OVERWRITTEN BT_UUID_DECLARE_16(BT_UUID_RAS_RD_OVERWRITTEN_VAL) | ||
|
||
#define BT_RAS_MAX_SUBEVENTS_PER_PROCEDURE 32 |
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 and the macro below are just needed to calculate the buffer size, right? So that we support the case where there are 256 steps in a procedure, spread across 32 subevents, such that each subevent has 8 steps ? And if I'm not mistaken this assumes a ranging data size of about ~10kB per procedure, including headers?
Maybe we should make this configurable ?
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.
Yes, it's used for buffer sizing and it does end up at around 10kB (9476 bytes):
#define BT_RAS_PROCEDURE_MEM (BT_RAS_RANGING_HEADER_LEN \
+ (BT_RAS_MAX_SUBEVENTS_PER_PROCEDURE * BT_RAS_SUBEVENT_HEADER_LEN) \
+ (BT_RAS_MAX_STEPS_PER_PROCEDURE * BT_RAS_STEP_MODE_LEN) \
+ (BT_RAS_MAX_STEPS_PER_PROCEDURE * BT_RAS_MAX_STEP_DATA_LEN))
The spec says
The RAS Server shall have memory to record at least one complete Ranging Data for one CS Procedure.
But as long as the defaults satisfy this, I think making it configurable makes sense.
I'll remove the macros for now and bring the configs with the rest of the RRSP implementation.
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 that sentence is still satisfied even without the maximum possible procedure size, don't you think so ? "one complete Ranging Data for one CS procedure" can also be a CS procedure with a single subevent and a small number of steps (at least the way I read it), as this would be complete ranging data
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's a bit vague as to what "complete" means, I read it as any valid ranging data procedure the peer might send, including one with the maximum number of steps.
I still agree it makes sense for this to be configurable, since the app will have better expectations on the data length it expects.
Do you think the default should not be 32/256?
2f78d75
to
c372f34
Compare
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause |
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.
can this file go?
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.
is it causing any issues ? We're trying to merge this in parts/stages
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 the file when you add the contents of the file, it doesn't make sense to add an empty file then add the contents in a different 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.
The two files are coming shortly in separate PRs; this has been split for ease of review.
If I don't bring them in then I won't have anything to put in zephyr_library_sources_ifdef for now so it'll be two empty CMakeLists.txt files instead.
I don't have a strong preference, can remove them and have empty cmakelists for now too - in either case the next PRs will follow as soon as this has been merged.
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.
if the cmake files would be empty, they can go, and be added in the PR adding the file contents
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.
Removed ras_rreq.c and the corresponding cmake file
@@ -0,0 +1,5 @@ | |||
/* | |||
* Copyright (c) 2024 Nordic Semiconductor ASA | |||
* |
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.
and this
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 implementation in b9bfd7f
include/bluetooth/services/ras.h
Outdated
struct ras_subevent_header { | ||
/** Starting ACL connection event count for the results reported in the event */ | ||
uint16_t start_acl_conn_event; | ||
/** Frequency compensation value in units of 0.01 ppm (15-bit signed integer) */ |
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.
here if possible I would suggest referencing BT_HCI_LE_CS_SUBEVENT_RESULT_FREQ_COMPENSATION_NOT_AVAILABLE (or mentioning that 0xC000 is a special value). Otherwise I think the user might not realize they need to check for this value before converting this to a signed integer
c372f34
to
b9bfd7f
Compare
…rvice This adds the base folder structure and headers to be used in the implementation of the Ranging Service draft specification. Signed-off-by: Aleksandar Stanoev <[email protected]>
ncs-dragoon is the only codeowner for RAS during development. Signed-off-by: Aleksandar Stanoev <[email protected]>
Create RAS primary service and support reading RRSP features. The initial RAS implementation will not support any optional features. Signed-off-by: Aleksandar Stanoev <[email protected]>
b9bfd7f
to
76d2287
Compare
This adds the base folder structure and headers to be used in the
implementation of the Ranging Service draft specification.
The ranging requester and ranging responder implementation will follow shortly,
this PR adds common headers and folders between the two modules.