mesh_keys.c (2d4000d1850724e5e3baecd65f36d42e5d35f76f) mesh_keys.c (d58a1b5f11ada8ddf896c41fff5a35e7f140c37e)
1/*
2 * Copyright (C) 2019 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 55 unchanged lines hidden (view full) ---

64 return MESH_KEYS_INVALID_INDEX;
65}
66
67void mesh_network_key_add(mesh_network_key_t * network_key){
68 mesh_network_key_used[network_key->internal_index] = 1;
69 btstack_linked_list_add_tail(&network_keys, (btstack_linked_item_t *) network_key);
70}
71
1/*
2 * Copyright (C) 2019 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 55 unchanged lines hidden (view full) ---

64 return MESH_KEYS_INVALID_INDEX;
65}
66
67void mesh_network_key_add(mesh_network_key_t * network_key){
68 mesh_network_key_used[network_key->internal_index] = 1;
69 btstack_linked_list_add_tail(&network_keys, (btstack_linked_item_t *) network_key);
70}
71
72int mesh_network_key_remove(mesh_network_key_t * network_key){
72bool mesh_network_key_remove(mesh_network_key_t * network_key){
73 mesh_network_key_used[network_key->internal_index] = 0;
74 return btstack_linked_list_remove(&network_keys, (btstack_linked_item_t *) network_key);
75}
76
77mesh_network_key_t * mesh_network_key_list_get(uint16_t netkey_index){
78 btstack_linked_list_iterator_t it;
79 btstack_linked_list_iterator_init(&it, &network_keys);
80 while (btstack_linked_list_iterator_has_next(&it)){

--- 75 unchanged lines hidden (view full) ---

156 return 0;
157}
158
159void mesh_transport_key_add(mesh_transport_key_t * transport_key){
160 mesh_transport_key_used[transport_key->internal_index] = 1;
161 btstack_linked_list_add_tail(&application_keys, (btstack_linked_item_t *) transport_key);
162}
163
73 mesh_network_key_used[network_key->internal_index] = 0;
74 return btstack_linked_list_remove(&network_keys, (btstack_linked_item_t *) network_key);
75}
76
77mesh_network_key_t * mesh_network_key_list_get(uint16_t netkey_index){
78 btstack_linked_list_iterator_t it;
79 btstack_linked_list_iterator_init(&it, &network_keys);
80 while (btstack_linked_list_iterator_has_next(&it)){

--- 75 unchanged lines hidden (view full) ---

156 return 0;
157}
158
159void mesh_transport_key_add(mesh_transport_key_t * transport_key){
160 mesh_transport_key_used[transport_key->internal_index] = 1;
161 btstack_linked_list_add_tail(&application_keys, (btstack_linked_item_t *) transport_key);
162}
163
164int mesh_transport_key_remove(mesh_transport_key_t * transport_key){
164bool mesh_transport_key_remove(mesh_transport_key_t * transport_key){
165 mesh_transport_key_used[transport_key->internal_index] = 0;
166 return btstack_linked_list_remove(&application_keys, (btstack_linked_item_t *) transport_key);
167}
168
169mesh_transport_key_t * mesh_transport_key_get(uint16_t appkey_index){
170 if (appkey_index == MESH_DEVICE_KEY_INDEX){
171 return &mesh_transport_device_key;
172 }

--- 63 unchanged lines hidden ---
165 mesh_transport_key_used[transport_key->internal_index] = 0;
166 return btstack_linked_list_remove(&application_keys, (btstack_linked_item_t *) transport_key);
167}
168
169mesh_transport_key_t * mesh_transport_key_get(uint16_t appkey_index){
170 if (appkey_index == MESH_DEVICE_KEY_INDEX){
171 return &mesh_transport_device_key;
172 }

--- 63 unchanged lines hidden ---