Skip to content
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

[wip] nimble/ll: Add initial Channel Sounding scheduling #1789

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
eeea62b
nimble/ll: Add DRBG for Channel Sounding
mkasenberg Apr 11, 2024
7d17bd0
nimble/ll: Add unit tests for CS DRBG
mkasenberg Feb 27, 2024
c5db1a7
nimble/host: ble_cs: Fix 'defined but not used' warning
mkasenberg Mar 14, 2024
5d22911
nimble/hci: Update Channel Sounding HCI
mkasenberg Apr 14, 2024
2b58317
nimble/ll: Add Channel Sounding state machine
mkasenberg Apr 14, 2024
e7357e4
nimble/ll: Add Channel Sounding LL CTRL opcodes
mkasenberg Apr 14, 2024
ed8615b
nimble/ll: Add Channel Sounding capabilities
mkasenberg Apr 14, 2024
5b3f6f4
nimble/ll: Add CS Capabilities Exchange procedure
mkasenberg Apr 14, 2024
6f03757
nimble/ll: Add LE CS Set Default Settings command
mkasenberg Apr 15, 2024
5b58cfc
nimble/ll: Add CS Mode-0 FAE Table Request procedure
mkasenberg Apr 15, 2024
22ca597
nimble/ll: Add CS Configuration procedure
mkasenberg Apr 15, 2024
df1612e
nimble/ll: Add CS Security Start procedure
mkasenberg Apr 16, 2024
7ac54d3
nimble/ll: Add LE CS Set Channel Classification command
mkasenberg Apr 16, 2024
95655da
nimble/ll: Add LE CS Set Procedure Parameters command
mkasenberg Apr 16, 2024
7526b64
nimble/ll: Add CS Start procedure
mkasenberg Apr 16, 2024
43c8369
nimble/ll: Add initial Channel Sounding scheduling
mkasenberg Apr 18, 2024
55d5847
nimble/ll: Add CS step modes and states
mkasenberg Apr 19, 2024
b47c73e
nimble/ll: Add to CS states support for multiple antenna paths
mkasenberg Apr 19, 2024
77d9626
nimble/ll: Add CS subevent states
mkasenberg Apr 19, 2024
61c37f7
nimble/ll: Add CS channel generation
mkasenberg Apr 23, 2024
171cd67
nimble/ll: Add packets durations to CS scheduling
mkasenberg Apr 24, 2024
d290192
nimble/ll: Add CS_SYNC transmission/reception
mkasenberg Apr 24, 2024
4763b54
nimble/ll: Add CS Procedure Repeat Termination procedure
mkasenberg Jun 3, 2024
ab3d026
nimble/ll: Add CS backtracking resistance
mkasenberg Jun 3, 2024
e0a5db2
nimble/phy: babblesim: Add missing g_ble_phy_t_txaddrdelay
mkasenberg Aug 22, 2024
59f3209
babblesim: Configure TIMER3 to 16MHz
mkasenberg Aug 22, 2024
d311788
nimble: host: CS fixes
mkasenberg Aug 22, 2024
4749d6c
nimble/apps: Add sample apps for CS initiator and reflector
mkasenberg Feb 5, 2024
c88f3b6
babblesim: targets: Add targets for CS apps
mkasenberg Feb 5, 2024
d2cbb2e
[wip] Quasi CS
mkasenberg Jun 5, 2024
4d4f8a1
[wip] nimble/phy: Add Channel Sounding to PHY
mkasenberg Jun 5, 2024
6c40e43
[wip] nimble/ll: Add usage of CS PHY
mkasenberg Aug 22, 2024
0af5711
[wip]nimble/ll: Add HCI Subevent Result (Continue) events
mkasenberg Aug 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions apps/cs_initiator/pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
pkg.name: apps/cs_initiator
pkg.type: app
pkg.description: Simple BLE central application.
pkg.author: "Apache Mynewt <[email protected]>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:

pkg.deps:
- "@apache-mynewt-core/kernel/os"
- "@apache-mynewt-core/sys/console"
- "@apache-mynewt-core/sys/log"
- "@apache-mynewt-core/sys/log/modlog"
- "@apache-mynewt-core/sys/stats"
- "@apache-mynewt-core/crypto/mbedtls"
- "@apache-mynewt-core/test/testutil"
- nimble/host
- nimble/host/util
- nimble/host/services/gap
- nimble/host/services/gatt
- nimble/host/store/config
106 changes: 106 additions & 0 deletions apps/cs_initiator/src/cs_initiator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifndef H_CS_INITIATOR_
#define H_CS_INITIATOR_

#include "os/mynewt.h"
#include "modlog/modlog.h"
#ifdef __cplusplus
extern "C" {
#endif

struct ble_hs_adv_fields;
struct ble_gap_conn_desc;
struct ble_hs_cfgble_hs_cfg;

#define GATT_SVR_SVC_CHANNEL_SOUNDING_UUID 0xffff
#define GATT_SVR_CHR_TOD_TOA_UUID 0xfffe
#define GATT_SVR_CHR_TOD_TOA_UUID 0xfffe

/** Misc. */
void print_bytes(const uint8_t *bytes, int len);
void print_mbuf(const struct os_mbuf *om);
char *addr_str(const void *addr);
void print_uuid(const ble_uuid_t *uuid);
void print_conn_desc(const struct ble_gap_conn_desc *desc);
void print_adv_fields(const struct ble_hs_adv_fields *fields);

/** Peer. */
struct peer_dsc {
SLIST_ENTRY(peer_dsc) next;
struct ble_gatt_dsc dsc;
};
SLIST_HEAD(peer_dsc_list, peer_dsc);

struct peer_chr {
SLIST_ENTRY(peer_chr) next;
struct ble_gatt_chr chr;

struct peer_dsc_list dscs;
};
SLIST_HEAD(peer_chr_list, peer_chr);

struct peer_svc {
SLIST_ENTRY(peer_svc) next;
struct ble_gatt_svc svc;

struct peer_chr_list chrs;
};
SLIST_HEAD(peer_svc_list, peer_svc);

struct peer;
typedef void peer_disc_fn(const struct peer *peer, int status, void *arg);

struct peer {
SLIST_ENTRY(peer) next;

uint16_t conn_handle;

/** List of discovered GATT services. */
struct peer_svc_list svcs;

/** Keeps track of where we are in the service discovery process. */
uint16_t disc_prev_chr_val;
struct peer_svc *cur_svc;

/** Callback that gets executed when service discovery completes. */
peer_disc_fn *disc_cb;
void *disc_cb_arg;
};

int peer_disc_all(uint16_t conn_handle, peer_disc_fn *disc_cb,
void *disc_cb_arg);
const struct peer_dsc *
peer_dsc_find_uuid(const struct peer *peer, const ble_uuid_t *svc_uuid,
const ble_uuid_t *chr_uuid, const ble_uuid_t *dsc_uuid);
const struct peer_chr *
peer_chr_find_uuid(const struct peer *peer, const ble_uuid_t *svc_uuid,
const ble_uuid_t *chr_uuid);
const struct peer_svc *
peer_svc_find_uuid(const struct peer *peer, const ble_uuid_t *uuid);
int peer_delete(uint16_t conn_handle);
int peer_add(uint16_t conn_handle);
int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs);

#ifdef __cplusplus
}
#endif

#endif
Loading
Loading