nRF5 SDK for Mesh v3.2.0
access_config.h
1 /* Copyright (c) 2010 - 2019, Nordic Semiconductor ASA
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form, except as embedded into a Nordic
11  * Semiconductor ASA integrated circuit in a product or a software update for
12  * such product, must reproduce the above copyright notice, this list of
13  * conditions and the following disclaimer in the documentation and/or other
14  * materials provided with the distribution.
15  *
16  * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
17  * contributors may be used to endorse or promote products derived from this
18  * software without specific prior written permission.
19  *
20  * 4. This software, with or without modification, must only be used with a
21  * Nordic Semiconductor ASA integrated circuit.
22  *
23  * 5. Any software provided in binary form under this license must not be reverse
24  * engineered, decompiled, modified and/or disassembled.
25  *
26  * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
27  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28  * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
29  * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef ACCESS_CONFIG_H__
39 #define ACCESS_CONFIG_H__
40 
41 #include <stdint.h>
42 #include "access.h"
43 #include "access_status.h"
44 #include "device_state_manager.h"
45 
68 bool access_flash_config_load(void);
69 
77 void access_flash_config_store(void);
78 
86 uint32_t access_default_ttl_set(uint8_t ttl);
87 
92 uint8_t access_default_ttl_get(void);
93 
111  dsm_handle_t address_handle);
121 
132 
147  dsm_handle_t * p_address_handle);
148 
159  access_publish_retransmit_t retransmit_params);
160 
173  access_publish_retransmit_t * p_retransmit_params);
174 
189 uint32_t access_model_publish_period_divisor_set(access_model_handle_t handle, uint16_t publish_divisor);
190 
210  access_publish_resolution_t resolution,
211  uint8_t step_number);
212 
225  access_publish_resolution_t * p_resolution,
226  uint8_t * p_step_number);
227 
239 uint32_t access_model_subscription_add(access_model_handle_t handle, dsm_handle_t address_handle);
240 
253 
269  dsm_handle_t * p_address_handles,
270  uint16_t * p_count);
271 
283 
295 
310  dsm_handle_t * p_appkey_handles,
311  uint16_t * p_count);
312 
326  dsm_handle_t appkey_handle);
327 
339  dsm_handle_t * p_appkey_handle);
340 
351 
363 
374 uint32_t access_model_publish_ttl_set(access_model_handle_t handle, uint8_t ttl);
375 
386 uint32_t access_model_publish_ttl_get(access_model_handle_t handle, uint8_t * p_ttl);
387 
398 uint32_t access_model_id_get(access_model_handle_t handle, access_model_id_t * p_model_id);
399 
410 uint32_t access_model_p_args_get(access_model_handle_t handle, void ** pp_args);
411 
428 
446 
467 
488 uint32_t access_element_location_set(uint16_t element_index, uint16_t location);
489 
503 uint32_t access_element_location_get(uint16_t element_index, uint16_t * p_location);
504 
515 uint32_t access_element_sig_model_count_get(uint16_t element_index, uint8_t * p_sig_model_count);
516 
527 uint32_t access_element_vendor_model_count_get(uint16_t element_index, uint8_t * p_vendor_model_count);
528 
541 uint32_t access_element_models_get(uint16_t element_index, access_model_handle_t * p_models, uint16_t * p_count);
542 
557 uint32_t access_handle_get(uint16_t element_index, access_model_id_t model_id, access_model_handle_t * p_handle);
558 
559 
565 const void * access_flash_area_get(void);
566 
568 #endif /* ACCESS_CONFIG_H__ */
uint32_t access_model_publish_address_get(access_model_handle_t handle, dsm_handle_t *p_address_handle)
Gets the current publish address for the given model.
uint32_t access_model_publish_application_set(access_model_handle_t handle, dsm_handle_t appkey_handle)
Sets the application key to be used when publishing for the given model.
uint32_t access_model_subscription_list_alloc(access_model_handle_t handle)
Allocates a subscription list for a model.
uint16_t access_model_handle_t
Access layer handle type.
Definition: access.h:162
uint32_t access_model_publish_retransmit_set(access_model_handle_t handle, access_publish_retransmit_t retransmit_params)
Sets the publish retransmit parameters for the given model.
uint32_t access_model_subscription_remove(access_model_handle_t handle, dsm_handle_t address_handle)
Removes a subscription from a model.
uint32_t access_model_subscriptions_get(access_model_handle_t handle, dsm_handle_t *p_address_handles, uint16_t *p_count)
Gets the address handles for the subscription addresses bound to a model.
uint32_t access_element_location_get(uint16_t element_index, uint16_t *p_location)
Gets the location descriptor for an element.
uint32_t access_model_publish_ttl_set(access_model_handle_t handle, uint8_t ttl)
Sets the default publication TTL value for the given model.
Model publish retransmit structure.
Definition: access.h:310
bool access_flash_config_load(void)
Recover access layer configuration from flash.
uint16_t dsm_handle_t
DSM handle type, used for the handles returned for the each set of data added.
void access_flash_config_store(void)
Store the current state of access layer - information related to element and model configuration - in...
uint32_t access_model_publish_ttl_get(access_model_handle_t handle, uint8_t *p_ttl)
Gets the default publication TTL value for the given model.
access_publish_resolution_t
Periodic publishing step resolution.
Definition: access.h:321
uint32_t access_model_publish_period_divisor_set(access_model_handle_t handle, uint16_t publish_divisor)
Sets the publish period divisor.
uint32_t access_model_application_bind(access_model_handle_t handle, dsm_handle_t appkey_handle)
Binds an application key to a model.
uint32_t access_model_id_get(access_model_handle_t handle, access_model_id_t *p_model_id)
Gets the model ID of for the given model.
uint32_t access_default_ttl_set(uint8_t ttl)
Sets the default TTL for the node.
uint32_t access_model_applications_get(access_model_handle_t handle, dsm_handle_t *p_appkey_handles, uint16_t *p_count)
Gets the applications bound to a model.
uint32_t access_model_application_unbind(access_model_handle_t handle, dsm_handle_t appkey_handle)
Unbinds an application key from a model.
uint32_t access_model_subscription_lists_share(access_model_handle_t owner, access_model_handle_t other)
Shares the subscription lists for two models.
uint32_t access_model_publish_address_set(access_model_handle_t handle, dsm_handle_t address_handle)
Changes the publish address for the given model.
uint32_t access_model_publish_retransmit_get(access_model_handle_t handle, access_publish_retransmit_t *p_retransmit_params)
Gets the current publish retransmit parameters for the given model.
uint32_t access_element_sig_model_count_get(uint16_t element_index, uint8_t *p_sig_model_count)
Gets the number of Bluetooth SIG models for an element.
uint32_t access_model_publication_stop(access_model_handle_t handle)
Stops the publication with the resetting of states for the given model.
uint32_t access_model_publish_period_set(access_model_handle_t handle, access_publish_resolution_t resolution, uint8_t step_number)
Sets the publish period for the given model.
const void * access_flash_area_get(void)
Gets a pointer to the flash area used by access.
uint32_t access_model_subscription_add(access_model_handle_t handle, dsm_handle_t address_handle)
Adds a subscription to a model.
uint8_t access_default_ttl_get(void)
Gets the default TTL for the node.
uint32_t access_handle_get(uint16_t element_index, access_model_id_t model_id, access_model_handle_t *p_handle)
Gets the access handle for the given model instance based on element index and model ID...
uint32_t access_element_models_get(uint16_t element_index, access_model_handle_t *p_models, uint16_t *p_count)
Gets the array of handles corresponding to an element.
uint32_t access_model_publication_by_appkey_stop(dsm_handle_t appkey_handle)
Stops the publication with the resetting of states for all models which are bound to the appkey_handl...
uint32_t access_model_publish_application_get(access_model_handle_t handle, dsm_handle_t *p_appkey_handle)
Gets the application key used when publishing for the given model.
Access layer model ID.
Definition: access.h:151
uint32_t access_element_location_set(uint16_t element_index, uint16_t location)
Sets the location descriptor for an element.
uint32_t access_model_publish_period_get(access_model_handle_t handle, access_publish_resolution_t *p_resolution, uint8_t *p_step_number)
Gets the publish period for the given model.
uint32_t access_model_subscription_list_dealloc(access_model_handle_t handle)
De-allocates a subscription list for a model.
uint32_t access_model_publish_friendship_credential_flag_set(access_model_handle_t handle, bool flag)
Sets the friendship credentials flag value for the given model.
uint32_t access_model_publish_friendship_credential_flag_get(access_model_handle_t handle, bool *p_flag)
Gets the friendship credentials flag value for the given model.
uint32_t access_model_p_args_get(access_model_handle_t handle, void **pp_args)
Gets the generic argument pointer bound to the given model.
uint32_t access_element_vendor_model_count_get(uint16_t element_index, uint8_t *p_vendor_model_count)
Gets the number of vendor specific models for an element.

Documentation feedback | Developer Zone | Subscribe | Updated