nRF5 SDK for Mesh v5.0.0
pb_remote_server.h
1 /* Copyright (c) 2010 - 2020, 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 PB_REMOTE_SERVER_H__
39 #define PB_REMOTE_SERVER_H__
40 
41 #include <stdint.h>
42 #include "access.h"
43 #include "access_reliable.h"
44 #include "provisioning.h"
45 
60 #define PB_REMOTE_SERVER_MODEL_ID (0x0004)
61 
62 #define PB_REMOTE_SERVER_UUID_LIST_SIZE (3)
63 
64 #ifndef PB_REMOTE_SERVER_ACKED_TRANSACTION_TIMEOUT
65 #define PB_REMOTE_SERVER_ACKED_TRANSACTION_TIMEOUT (SEC_TO_US(60))
66 #endif
67 
71 typedef enum
72 {
88 
94 typedef struct
95 {
103  prov_bearer_t * p_prov_bearer;
111 
127 uint32_t pb_remote_server_init(pb_remote_server_t * p_server, uint16_t element_index);
128 
139 uint32_t pb_remote_server_enable(pb_remote_server_t * p_server);
140 
153 uint32_t pb_remote_server_disable(pb_remote_server_t * p_server);
154 
164 uint32_t pb_remote_server_return_to_scan_set(pb_remote_server_t * p_server, bool state);
165 
175 uint32_t pb_remote_server_prov_bearer_set(pb_remote_server_t * p_server, prov_bearer_t * p_prov_bearer);
176 
179 #endif /* PB_REMOTE_SERVER_H_ */
uint32_t pb_remote_server_prov_bearer_set(pb_remote_server_t *p_server, prov_bearer_t *p_prov_bearer)
Sets the provisioning bearer for the remote provisioning server.
uint16_t access_model_handle_t
Access layer handle type.
Definition: access.h:162
Initialized and idle state.
Uninitialized state.
Waiting for remote acknowledgement of scan filter report.
Waiting for local acknowledgment.
Waiting for remote acknowledgement of scan report.
access_reliable_t reliable
Access layer reliable message parameter structure.
Waiting for local link to open.
uint8_t current_prov_pdu_type
Current Provisioning PDU Type.
uint32_t pb_remote_server_init(pb_remote_server_t *p_server, uint16_t element_index)
Initializes the remote provisioning server model.
uint32_t pb_remote_server_return_to_scan_set(pb_remote_server_t *p_server, bool state)
Sets the return to scan state.
uint32_t pb_remote_server_enable(pb_remote_server_t *p_server)
Enables the remote provisioning server.
pb_remote_server_state_t prev_state
Remote provisioning server previous state.
pb_remote_server_state_t state
Remote provisioning server current state.
Access layer acknowledged publish parameter structure.
Waiting for remote acknowledgment of PDU/report.
Waiting for remote acknowledgment of closed link.
Waiting for remote acknowledgment of opened link.
prov_bearer_t * p_prov_bearer
Provisioning bearer context structure.
Remote provisioning server context structure.
access_model_handle_t model_handle
Access layer model handle.
uint32_t pb_remote_server_disable(pb_remote_server_t *p_server)
Disables the remote provisioning server.
bool return_to_scan_enabled
If set true, the server automatically returns to scanning mode after provisioning.
Scanning with a UUID filter.
Waiting for local link to close.
pb_remote_server_state_t
Remote Provisioning Server states.
Scanning for unprovisioned devices.

Documentation feedback | Developer Zone | Subscribe | Updated