nRF5 SDK for Mesh v5.0.0
pb_remote_client.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 #ifndef PB_REMOTE_CLIENT_H__
38 #define PB_REMOTE_CLIENT_H__
39 
40 #include <stdint.h>
41 #include "access.h"
42 #include "access_reliable.h"
43 #include "nrf_mesh_prov.h"
44 
60 #define PB_REMOTE_CLIENT_MODEL_ID (0x8004)
61 
63 #ifndef PB_REMOTE_CLIENT_ACKED_TRANSACTION_TIMEOUT
64 #define PB_REMOTE_CLIENT_ACKED_TRANSACTION_TIMEOUT (SEC_TO_US(60))
65 #endif
66 
68 typedef enum
69 {
95 
97 typedef struct
98 {
100  const uint8_t * p_uuid;
102  uint8_t device_id;
104 
106 typedef struct
107 {
113 
119 typedef void (*pb_remote_client_event_cb_t)(const pb_remote_event_t * p_evt);
120 
124 typedef enum
125 {
129  PB_REMOTE_CLIENT_STATE_WAIT_ACK_LINK,
130  PB_REMOTE_CLIENT_STATE_WAIT_ACK_TRANSFER,
131  PB_REMOTE_CLIENT_STATE_WAIT_ACK_SCAN,
133 
139 typedef struct
140 {
144  prov_bearer_t prov_bearer;
154 
169 uint32_t pb_remote_client_init(pb_remote_client_t * p_client,
170  uint16_t element_index,
171  pb_remote_client_event_cb_t event_cb);
172 
183 
200 
217 
220 #endif /* PB_REMOTE_CLIENT_H__ */
The remote link was closed.
uint16_t access_model_handle_t
Access layer handle type.
Definition: access.h:162
Uninitialized state.
Received a remote UUID from the server.
pb_remote_event_type_t
Remote provisioning client event types.
pb_remote_event_type_t type
Event type.
The remote could not open link.
The remote could not close the link.
const uint8_t * p_uuid
The NRF_MESH_UUID_SIZE byte long UUID of the unprovisioned device.
The remote got a link close command for an inactive link.
access_model_handle_t model_handle
Model handle for the client.
uint32_t pb_remote_client_remote_scan_cancel(pb_remote_client_t *p_client)
Cancels the remote scanning procedure.
pb_remote_event_remote_uuid_t remote_uuid
Remote UUID parameters for the PB_REMOTE_EVENT_REMOTE_UUID event.
uint8_t device_id
ID of the unprovisioned device given by the server.
Remote UUID event data.
The remote could not cancel the scanning procedure.
Remote provisioning link is established.
uint8_t current_prov_pdu_type
Current Provisioning PDU Type.
Initialized and idle state.
access_reliable_t reliable
Access layer reliable message parameter structure.
void(* pb_remote_client_event_cb_t)(const pb_remote_event_t *p_evt)
Remote provisioning client event handler callback function.
Link is already active.
uint32_t pb_remote_client_remote_scan_start(pb_remote_client_t *p_client)
Initiates the remote scanning procedure.
prov_bearer_t prov_bearer
Provisioning context structure pointer.
The remote has started scanning.
The unprovisioned device ID was not recognized by the server.
Access layer acknowledged publish parameter structure.
pb_remote_client_state_t
Remote Provisioning Client states.
Remote provisioning event structure.
Remote Provisioning Client context structure.
uint32_t pb_remote_client_init(pb_remote_client_t *p_client, uint16_t element_index, pb_remote_client_event_cb_t event_cb)
Initializes the Remote provisioning client model.
The remote has cancelled the scanning.
prov_bearer_t * pb_remote_client_bearer_interface_get(pb_remote_client_t *p_client)
Gets the remote Remote provisioning client&#39;s bearer interface.
The remote could not start the scanning procedure.
pb_remote_client_state_t state
Remote provisioning Client state.
pb_remote_client_event_cb_t event_cb
User event callback.
The session failed because of no response from the remote.

Documentation feedback | Developer Zone | Subscribe | Updated