mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
mesh: make mesh_subnet_get_outgoing_network_key public
This commit is contained in:
parent
d134d597d2
commit
9a470f7ba0
@ -133,7 +133,6 @@ static int mesh_network_cache_index;
|
|||||||
|
|
||||||
static void mesh_network_run(void);
|
static void mesh_network_run(void);
|
||||||
static void process_network_pdu_validate(mesh_network_pdu_t * network_pdu);
|
static void process_network_pdu_validate(mesh_network_pdu_t * network_pdu);
|
||||||
static mesh_network_key_t * mesh_subnet_get_outgoing_network_key(mesh_subnet_t * subnet);
|
|
||||||
|
|
||||||
// network caching
|
// network caching
|
||||||
static uint32_t mesh_network_cache_hash(mesh_network_pdu_t * network_pdu){
|
static uint32_t mesh_network_cache_hash(mesh_network_pdu_t * network_pdu){
|
||||||
@ -1085,9 +1084,15 @@ mesh_subnet_t * mesh_subnet_iterator_get_next(mesh_subnet_iterator_t *it){
|
|||||||
return (mesh_subnet_t *) btstack_linked_list_iterator_next(&it->it);
|
return (mesh_subnet_t *) btstack_linked_list_iterator_next(&it->it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static mesh_network_key_t * mesh_subnet_get_outgoing_network_key(mesh_subnet_t * subnet){
|
mesh_network_key_t * mesh_subnet_get_outgoing_network_key(mesh_subnet_t * subnet){
|
||||||
// TODO: old vs. new depends on key resfresh
|
switch (subnet->key_refresh){
|
||||||
return subnet->old_key;
|
case MESH_KEY_REFRESH_SECOND_PHASE:
|
||||||
|
return subnet->new_key;
|
||||||
|
case MESH_KEY_REFRESH_NOT_ACTIVE:
|
||||||
|
case MESH_KEY_REFRESH_FIRST_PHASE:
|
||||||
|
default:
|
||||||
|
return subnet->old_key;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -335,6 +335,11 @@ mesh_subnet_t * mesh_subnet_iterator_get_next(mesh_subnet_iterator_t *it);
|
|||||||
void mesh_subnet_update_for_netkey_index(uint16_t netkey_index);
|
void mesh_subnet_update_for_netkey_index(uint16_t netkey_index);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get outgoing network key for subnet based on key refresh phase
|
||||||
|
*/
|
||||||
|
mesh_network_key_t * mesh_subnet_get_outgoing_network_key(mesh_subnet_t * subnet);
|
||||||
|
|
||||||
// buffer pool
|
// buffer pool
|
||||||
mesh_network_pdu_t * mesh_network_pdu_get(void);
|
mesh_network_pdu_t * mesh_network_pdu_get(void);
|
||||||
void mesh_network_pdu_free(mesh_network_pdu_t * network_pdu);
|
void mesh_network_pdu_free(mesh_network_pdu_t * network_pdu);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user