|
19 | 19 | */ |
20 | 20 |
|
21 | 21 | #include <stdbool.h> |
| 22 | +#include <stdint.h> |
22 | 23 | #include <string.h> |
23 | 24 |
|
24 | 25 | #include <zephyr/sys/util.h> |
@@ -48,6 +49,13 @@ extern "C" { |
48 | 49 | */ |
49 | 50 | #define BT_ID_DEFAULT 0 |
50 | 51 |
|
| 52 | +/** |
| 53 | + * @brief Number of octets for local supported |
| 54 | + * |
| 55 | + * The value of 8 correspond to page 0 in the LE Controller supported features |
| 56 | + */ |
| 57 | +#define BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE 8 |
| 58 | + |
51 | 59 | /** Opaque type representing an advertiser. */ |
52 | 60 | struct bt_le_ext_adv; |
53 | 61 |
|
@@ -517,6 +525,78 @@ size_t bt_data_get_len(const struct bt_data data[], size_t data_count); |
517 | 525 | */ |
518 | 526 | size_t bt_data_serialize(const struct bt_data *input, uint8_t *output); |
519 | 527 |
|
| 528 | +struct bt_le_local_features { |
| 529 | + /** |
| 530 | + * @brief Local LE controller supported features. |
| 531 | + * |
| 532 | + * Refer to BT_LE_FEAT_BIT_* for values. |
| 533 | + * Refer to the BT_FEAT_LE_* macros for value comparionson. |
| 534 | + * See Bluetooth Core Specification, Vol 6, Part B, Section 4.6. |
| 535 | + */ |
| 536 | + uint8_t features[BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE]; |
| 537 | + |
| 538 | + /** |
| 539 | + * @brief Local LE controller supported states |
| 540 | + * |
| 541 | + * Refer to BT_LE_STATES_* for values. |
| 542 | + * See Bluetooth Core Specification 6.0, Vol 4, Part E, Section 7.8.27 |
| 543 | + */ |
| 544 | + uint64_t states; |
| 545 | + |
| 546 | + /** |
| 547 | + * @brief ACL data packet length |
| 548 | + * |
| 549 | + * This represents the maximum ACL HCI Data packet which can be sent from the Host to the |
| 550 | + * Controller. |
| 551 | + * The Host may support L2CAP and ATT MTUs larger than this value. |
| 552 | + * See Bluetooth Core Specification, Vol 6, Part E, Section 7.8.2. |
| 553 | + */ |
| 554 | + uint16_t acl_mtu; |
| 555 | + /** Total number of ACL data packets */ |
| 556 | + uint8_t acl_pkts; |
| 557 | + |
| 558 | + /** |
| 559 | + * @brief ISO data packet length |
| 560 | + * |
| 561 | + * This represents the maximum ISO HCI Data packet which can be sent from the Host to the |
| 562 | + * Controller. |
| 563 | + * ISO SDUs above this size can be fragmented assuming that the number of |
| 564 | + * @ref bt_le_local_features.iso_pkts support the maximum size. |
| 565 | + */ |
| 566 | + uint16_t iso_mtu; |
| 567 | + /** Total number of ISO data packets */ |
| 568 | + uint8_t iso_pkts; |
| 569 | + |
| 570 | + /** |
| 571 | + * @brief Maximum size of the controller resolving list. |
| 572 | + * |
| 573 | + * See Bluetooth Core Specification, Vol 6, Part E, Section 7.8.41. |
| 574 | + */ |
| 575 | + uint8_t rl_size; |
| 576 | + |
| 577 | + /** |
| 578 | + * @brief Maximum advertising data length |
| 579 | + * |
| 580 | + * @note The maximum advertising data length also depends on advertising type. |
| 581 | + * |
| 582 | + * See Bluetooth Core Specification, Vol 6, Part E, Section 7.8.57. |
| 583 | + */ |
| 584 | + uint16_t max_adv_data_len; |
| 585 | +}; |
| 586 | + |
| 587 | +/** |
| 588 | + * @brief Get local Bluetooth LE controller features |
| 589 | + * |
| 590 | + * Can only be called after bt_enable() |
| 591 | + * |
| 592 | + * @param local_features Local features struct to be populated with information. |
| 593 | + * |
| 594 | + * @retval 0 Success |
| 595 | + * @retval -EAGAIN The information is not yet available. |
| 596 | + * @retval -EINVAL @p local_features is NULL. |
| 597 | + */ |
| 598 | +int bt_le_get_local_features(struct bt_le_local_features *local_features); |
| 599 | + |
520 | 600 | /** Advertising options */ |
521 | 601 | enum { |
522 | 602 | /** Convenience value when no options are specified. */ |
|
0 commit comments