Skip to content

Commit

Permalink
Merge branch 'ingchips:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Inchips-zb authored Apr 9, 2024
2 parents 158224b + d84ebb7 commit 20a251e
Show file tree
Hide file tree
Showing 469 changed files with 18,850 additions and 11,883 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ contributions via Github [Pull Requests](pulls) in the `develop` branch.

## License

Copyright 2019-2023 INGCHIPS
Copyright 2019-2024 INGCHIPS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
809 changes: 412 additions & 397 deletions bundles/exp/ING9168xx/apis.json

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions bundles/exp/ING9168xx/meta.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"app": {
"base": 33738752
"base": 33742848
},
"ram": {
"base": 536870912,
"size": 21828
"size": 21636
},
"rom": {
"base": 33562624,
"size": 173864
"size": 178692
},
"var": {
"link_layer_features": {
"addr": 33732720,
"value": "ff79ff07fe000000"
}
},
"version": [
2,
3,
1
18
]
}
Binary file modified bundles/exp/ING9168xx/platform.bin
Binary file not shown.
727 changes: 367 additions & 360 deletions bundles/exp/ING9187xx/apis.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions bundles/exp/ING9187xx/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
},
"ram": {
"base": 536870912,
"size": 30268
"size": 30076
},
"rom": {
"base": 16384,
"size": 151996
"size": 153108
},
"var": {
"link_layer_features": {
"addr": 164840,
"value": "bff90104fe000000"
}
},
"version": [
1,
9,
41
56
]
}
Binary file modified bundles/exp/ING9187xx/platform.bin
Binary file not shown.
765 changes: 386 additions & 379 deletions bundles/exp/ING9188xx/apis.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions bundles/exp/ING9188xx/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
},
"ram": {
"base": 536870912,
"size": 30268
"size": 30076
},
"rom": {
"base": 16384,
"size": 158908
"size": 160024
},
"var": {
"link_layer_features": {
"addr": 171416,
"value": "bff9ff07fe000000"
}
},
"version": [
1,
9,
41
56
]
}
Binary file modified bundles/exp/ING9188xx/platform.bin
Binary file not shown.
10 changes: 7 additions & 3 deletions bundles/exp/inc/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ typedef uint8_t bd_addr_t[BD_ADDR_LEN];
typedef enum {
BD_ADDR_TYPE_LE_PUBLIC = 0,
BD_ADDR_TYPE_LE_RANDOM = 0x01,
BD_ADDR_TYPE_LE_RESOVLED_PUB = 0x02,
BD_ADDR_TYPE_LE_RESOVLED_RAN = 0x03
BD_ADDR_TYPE_LE_RESOLVED_PUB = 0x02,
BD_ADDR_TYPE_LE_RESOLVED_RAN = 0x03
} bd_addr_type_t;

// back-compatibility for typos
#define BD_ADDR_TYPE_LE_RESOVLED_PUB BD_ADDR_TYPE_LE_RESOLVED_PUB
#define BD_ADDR_TYPE_LE_RESOVLED_RAN BD_ADDR_TYPE_LE_RESOLVED_RAN

/**
* @brief link key
*/
Expand Down Expand Up @@ -718,7 +722,7 @@ typedef enum {
#define SM_AUTHREQ_NO_BONDING 0x00
#define SM_AUTHREQ_BONDING 0x01
#define SM_AUTHREQ_MITM_PROTECTION 0x04
#define SM_AUTHREQ_SC 0x08
#define SM_AUTHREQ_SC 0x08 // support of LE Secure Connections pairing

// Key distribution flags used by spec
#define SM_KEYDIST_ENC_KEY 0X01
Expand Down
14 changes: 14 additions & 0 deletions bundles/exp/inc/btstack_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,20 @@
*/
#define SM_EVENT_STATE_CHANGED 0xDC

/**
* @format H1B1
* @param handle
* @param show calculated numeric value that needs to be compared
*/
#define SM_EVENT_NUMERIC_COMPARISON_REQUEST 0xDD

/**
* @format PP
* @param irk
* @param dhk
*/
#define SM_EVENT_IRK_DHK_RESULT 0xDE

// GAP

/**
Expand Down
53 changes: 53 additions & 0 deletions bundles/exp/inc/btstack_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,21 @@ uint32_t btstack_push_user_runnable(f_btstack_user_runnable fun, void *data, con
*/
uint8_t btstack_reset(void);

typedef struct btstack_capabilities
{
uint16_t adv_set_num; // max number of advertising sets
uint16_t conn_num; // max number of connections
uint16_t max_mtu; // max MTU
uint16_t device_db_num; // max number of devices in database
} btstack_capabilities_t;

/**
* @brief Get BT stack capabilities.
*
* @param[out] capabilities see `btstack_capabilities_t`.
*/
void btstack_get_capabilities(btstack_capabilities_t *capabilities);

/***
* @brief Get subevent code for le event
* @param event packet
Expand Down Expand Up @@ -780,6 +795,26 @@ static __INLINE hci_con_handle_t sm_event_numeric_comparison_get_handle(const ui
return little_endian_read_16(event, 2);
}

/**
* @brief Get field addr_type from event SM_EVENT_NUMERIC_COMPARISON_REQUEST
* @param event packet
* @return addr_type
* @note: btstack_type 1
*/
static __INLINE uint8_t sm_event_numeric_comparison_get_addr_type(const uint8_t * event){
return *decode_event_offset(event, uint8_t, 4);
}

/**
* @brief Get field address from event SM_EVENT_NUMERIC_COMPARISON_REQUEST
* @param event packet
* @param Pointer to storage for address
* @note: btstack_type B
*/
static __INLINE void sm_event_numeric_comparison_get_address(const uint8_t * event, uint8_t * address){
reverse_bd_addr(decode_event_offset(event, uint8_t, 5), address);
}

/**
* @brief Get field compare value from event SM_EVENT_NUMERIC_COMPARISON_REQUEST
* @param event packet
Expand All @@ -790,6 +825,24 @@ static __INLINE uint32_t sm_event_numeric_comparison_get_compare_value(const uin
return little_endian_read_32(event, 11);
}

/**
* @brief Get IRK from event SM_EVENT_IRK_DHK_RESULT
* @param event packet
* @return irk
*/
static __INLINE const uint8_t *sm_event_irk_dhk_result_get_irk(const uint8_t *event) {
return *decode_event_offset(event, uint8_t *, 2);
}

/**
* @brief Get DHK from event SM_EVENT_IRK_DHK_RESULT
* @param event packet
* @return dhk
*/
static __INLINE const uint8_t *sm_event_irk_dhk_result_get_dhk(const uint8_t *event) {
return *decode_event_offset(event, uint8_t *, 2 + sizeof(uintptr_t));
}

/**
* @brief Get field handle from event GAP_EVENT_SECURITY_LEVEL
* @param event packet
Expand Down
Loading

0 comments on commit 20a251e

Please sign in to comment.