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 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of the copyright holders nor the names of 14 * contributors may be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * 4. Any redistribution, use, or modification is done solely for 17 * personal benefit and not for any commercial purpose or for 18 * monetary gain. 19 * 20 * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN 24 * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * Please inquire about commercial licensing options at 34 * [email protected] 35 * 36 */ 37 38 #ifndef __MESH_CONFIGURATION_CLIENT_H 39 #define __MESH_CONFIGURATION_CLIENT_H 40 41 #include <stdint.h> 42 43 #include "mesh/mesh_access.h" 44 45 #ifdef __cplusplus 46 extern "C" 47 { 48 #endif 49 50 51 typedef struct { 52 const uint8_t * models; 53 uint16_t size; 54 uint16_t offset; 55 56 uint32_t id; 57 } mesh_model_id_iterator_t; 58 59 typedef struct { 60 const uint8_t * elements; 61 uint16_t size; 62 uint16_t offset; 63 64 uint16_t loc; 65 66 mesh_model_id_iterator_t sig_model_iterator; 67 mesh_model_id_iterator_t vendor_model_iterator; 68 } mesh_composite_data_iterator_t; 69 70 typedef struct { 71 uint16_t publish_address_unicast; 72 uint8_t publish_address_virtual[16]; 73 uint16_t appkey_index; 74 uint8_t credential_flag; 75 uint8_t publish_ttl; 76 uint8_t publish_period; 77 uint8_t publish_retransmit_count; 78 uint8_t publish_retransmit_interval_steps; 79 } mesh_publication_model_config_t; 80 81 const mesh_operation_t * mesh_configuration_client_get_operations(void); 82 83 /** 84 * @brief Initialize iterator for element descriptions list from Composition data in MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA event 85 * @param iterator 86 * @param elements 87 * @param size 88 */ 89 void mesh_composition_data_iterator_init(mesh_composite_data_iterator_t * iterator, const uint8_t * elements, uint16_t size); 90 91 /** 92 * @brief Check if there is another element description in the list 93 * @param iterator 94 * @return has_next_element 95 */ 96 bool mesh_composition_data_iterator_has_next_element(mesh_composite_data_iterator_t * iterator); 97 98 /** 99 * @brief Select the next element 100 * @param iterator 101 */ 102 void mesh_composition_data_iterator_next_element(mesh_composite_data_iterator_t * iterator); 103 104 /** 105 * @brief Get the element location descriptor for the current element 106 * @param iterator 107 * @return loc 108 */ 109 uint16_t mesh_composition_data_iterator_element_loc(mesh_composite_data_iterator_t * iterator); 110 111 /** 112 * @brief Check if there is another SIG model in current element 113 * @param iterator 114 * @return has_next_sig_model 115 */ 116 bool mesh_composition_data_iterator_has_next_sig_model(mesh_composite_data_iterator_t * iterator); 117 118 /** 119 * @brief Select the next SIG model 120 * @param iterator 121 */ 122 void mesh_composition_data_iterator_next_sig_model(mesh_composite_data_iterator_t * iterator); 123 124 /** 125 * @brief Get the SIG model ID for the current SIG model of the current element 126 * @param iterator 127 * @return loc 128 */ 129 uint16_t mesh_composition_data_iterator_sig_model_id(mesh_composite_data_iterator_t * iterator); 130 131 132 /** 133 * @brief Check if there is another vendor model in current element 134 * @param iterator 135 * @return has_next_vendor_model 136 */ 137 bool mesh_composition_data_iterator_has_next_vendor_model(mesh_composite_data_iterator_t * iterator); 138 139 /** 140 * @brief Select the next VVendor model 141 * @param iterator 142 */ 143 void mesh_composition_data_iterator_next_vendor_model(mesh_composite_data_iterator_t * iterator); 144 145 /** 146 * @brief Get the Vendor model ID for the current vendor model of the current element 147 * @param iterator 148 * @return loc 149 */ 150 uint32_t mesh_composition_data_iterator_vendor_model_id(mesh_composite_data_iterator_t * iterator); 151 152 /** 153 * @brief Get field page from event MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 154 * @param event packet 155 * @return page 156 * @note: btstack_type 1 157 */ 158 uint8_t mesh_subevent_configuration_composition_data_get_page(const uint8_t * event); 159 160 /** 161 * @brief Get field cid from event MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 162 * @param event packet 163 * @return cid 164 * @note: btstack_type 2 165 */ 166 uint16_t mesh_subevent_configuration_composition_data_get_cid(const uint8_t * event); 167 168 /** 169 * @brief Get field pid from event MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 170 * @param event packet 171 * @return pid 172 * @note: btstack_type 2 173 */ 174 uint16_t mesh_subevent_configuration_composition_data_get_pid(const uint8_t * event); 175 176 /** 177 * @brief Get field vid from event MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 178 * @param event packet 179 * @return vid 180 * @note: btstack_type 2 181 */ 182 uint16_t mesh_subevent_configuration_composition_data_get_vid(const uint8_t * event); 183 184 /** 185 * @brief Get field crpl from event MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 186 * @param event packet 187 * @return crpl 188 * @note: btstack_type 2 189 */ 190 uint16_t mesh_subevent_configuration_composition_data_get_crpl(const uint8_t * event); 191 192 /** 193 * @brief Get field features from event MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 194 * @param event packet 195 * @return features 196 * @note: btstack_type 2 197 */ 198 uint16_t mesh_subevent_configuration_composition_data_get_features(const uint8_t * event); 199 200 /** 201 * @brief Get number elements from event MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 202 **/ 203 uint16_t mesh_subevent_configuration_composition_data_get_num_elements(const uint8_t * event, uint16_t size); 204 205 206 /** 207 * @brief Register packet handler 208 * @param configuration_client_model 209 * @param events_packet_handler 210 */ 211 void mesh_configuration_client_register_packet_handler(mesh_model_t *configuration_client_model, btstack_packet_handler_t events_packet_handler); 212 213 /** 214 * @brief Get the current Secure Network Beacon state of a node. 215 * @param mesh_model 216 * @param dest 217 * @param netkey_index 218 * @param appkey_index 219 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 220 */ 221 uint8_t mesh_configuration_client_send_beacon_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 222 223 /** 224 * @brief Get the current Secure Network Beacon state of a node. 225 * @param mesh_model 226 * @param dest 227 * @param netkey_index 228 * @param appkey_index 229 * @param Beacon 0x01 The node is broadcasting a Secure Network beacon, 0x00 broadcastinis off 230 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 231 */ 232 uint8_t mesh_configuration_client_send_beacon_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t beacon); 233 234 /** 235 * @brief Read one page of the Composition Data. 236 * @param mesh_model 237 * @param dest 238 * @param netkey_index 239 * @param appkey_index 240 * @param page Page number of the Composition Data 241 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 242 */ 243 uint8_t mesh_configuration_client_send_composition_data_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t page); 244 245 /** 246 * @brief Get the current Default TTL state of a node 247 * @param mesh_model 248 * @param dest 249 * @param netkey_index 250 * @param appkey_index 251 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 252 */ 253 uint8_t mesh_configuration_client_send_default_ttl_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 254 255 /** 256 * @brief Set Default TTL state of a node 257 * @param mesh_model 258 * @param dest 259 * @param netkey_index 260 * @param appkey_index 261 * @param ttl allowed values: 0x00, 0x02–0x7F 262 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 263 */ 264 uint8_t mesh_configuration_client_send_default_ttl_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t ttl); 265 266 /** 267 * @brief Get the current Default GATT proxy state of a node 268 * @param mesh_model 269 * @param dest 270 * @param netkey_index 271 * @param appkey_index 272 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 273 */ 274 uint8_t mesh_configuration_client_send_gatt_proxy_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 275 276 /** 277 * @brief Set Default GATT proxy state of a node 278 * @param mesh_model 279 * @param dest 280 * @param netkey_index 281 * @param appkey_index 282 * @param gatt_proxy_state 0 - the proxy feature is supported and disabled, 1 - supported and enabled, 2 - not supported 283 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 284 */ 285 uint8_t mesh_configuration_client_send_gatt_proxy_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t gatt_proxy_state); 286 287 288 /** 289 * @brief Get the current Relay and Relay Retransmit states of a node 290 * @param mesh_model 291 * @param dest 292 * @param netkey_index 293 * @param appkey_index 294 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 295 */ 296 uint8_t mesh_configuration_client_send_relay_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 297 298 /** 299 * @brief Set the current Relay and Relay Retransmit states of a node 300 * @param mesh_model 301 * @param dest 302 * @param netkey_index 303 * @param appkey_index 304 * @param relay 305 * @param relay_retransmit_count 306 * @param relay_retransmit_interval_steps 307 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 308 */ 309 uint8_t mesh_configuration_client_send_relay_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t relay, uint8_t relay_retransmit_count, uint8_t relay_retransmit_interval_steps); 310 311 /** 312 * @brief Get the publish address and parameters of an outgoing message that originates from a model 313 * @param mesh_model 314 * @param dest element_address 315 * @param netkey_index 316 * @param appkey_index 317 * @param model_id 318 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 319 */ 320 uint8_t mesh_configuration_client_send_model_publication_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint32_t model_id); 321 322 /** 323 * @brief Set the Model Publication state of an outgoing message that originates from a model. 324 * @param mesh_model 325 * @param dest element_address 326 * @param netkey_index 327 * @param appkey_index 328 * @param model_id 329 * @param publication_config 330 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 331 */ 332 uint8_t mesh_configuration_client_send_model_publication_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint32_t model_id, mesh_publication_model_config_t * publication_config); 333 334 /** 335 * @brief Set the Model Publication state of an outgoing message that originates from a model. 336 * @param mesh_model 337 * @param dest element_address 338 * @param netkey_index 339 * @param appkey_index 340 * @param model_id 341 * @param publication_config 342 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 343 */ 344 uint8_t mesh_configuration_client_send_model_publication_virtual_address_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint32_t model_id, mesh_publication_model_config_t * publication_config); 345 346 /** 347 * @brief Add an address to a Subscription List of a model 348 * @param mesh_model 349 * @param dest element_address 350 * @param netkey_index 351 * @param appkey_index 352 * @param address 353 * @param model_id 354 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 355 */ 356 uint8_t mesh_configuration_client_send_model_subscription_add(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t address, uint32_t model_id); 357 uint8_t mesh_configuration_client_send_model_subscription_virtual_address_add(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t * address, uint32_t model_id); 358 359 /** 360 * @brief Delete an address from a Subscription List of a model 361 * @param mesh_model 362 * @param dest element_address 363 * @param netkey_index 364 * @param appkey_index 365 * @param address 366 * @param model_id 367 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 368 */ 369 uint8_t mesh_configuration_client_send_model_subscription_delete(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t address, uint32_t model_id); 370 uint8_t mesh_configuration_client_send_model_subscription_virtual_address_delete(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t * address, uint32_t model_id); 371 372 /** 373 * @brief Discard the Subscription List and add an address to the cleared Subscription List of a model 374 * @param mesh_model 375 * @param dest element_address 376 * @param netkey_index 377 * @param appkey_index 378 * @param address 379 * @param model_id 380 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 381 */ 382 uint8_t mesh_configuration_client_send_model_subscription_overwrite(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t address, uint32_t model_id); 383 uint8_t mesh_configuration_client_send_model_subscription_virtual_address_overwrite(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t * address, uint32_t model_id); 384 385 /** 386 * @brief Discard the Subscription List of a model 387 * @param mesh_model 388 * @param dest element_address 389 * @param netkey_index 390 * @param appkey_index 391 * @param address 392 * @param model_id 393 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 394 */ 395 uint8_t mesh_configuration_client_send_model_subscription_delete_all(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t address, uint32_t model_id); 396 397 /** 398 * @brief Get the list of subscription addresses of a SIG or vendor model within the element 399 * @param mesh_model 400 * @param dest element_address 401 * @param netkey_index 402 * @param appkey_index 403 * @param vendor_model_id 404 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 405 */ 406 uint8_t mesh_configuration_client_send_model_subscription_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint32_t model_id); 407 408 409 /** 410 * @brief Add a NetKey to a NetKey List on a node. 411 * @param mesh_model 412 * @param dest element_address 413 * @param netkey_index 414 * @param appkey_index 415 * @param index 416 * @param netkey 417 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 418 */ 419 uint8_t mesh_configuration_client_send_netkey_add(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t index, uint8_t * netkey); 420 421 /** 422 * @brief Update NetKey in a NetKey List on a node. 423 * @param mesh_model 424 * @param dest element_address 425 * @param netkey_index 426 * @param appkey_index 427 * @param index 428 * @param netkey 429 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 430 */ 431 uint8_t mesh_configuration_client_send_netkey_update(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t index, uint8_t * netkey); 432 433 /** 434 * @brief Delete a NetKey from a NetKey List on a node. 435 * @param mesh_model 436 * @param dest element_address 437 * @param netkey_index 438 * @param appkey_index 439 * @param index 440 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 441 */ 442 uint8_t mesh_configuration_client_send_netkey_delete(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t index); 443 444 /** 445 * @brief Get NetKey List on a node. 446 * @param mesh_model 447 * @param dest element_address 448 * @param netkey_index 449 * @param appkey_index 450 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 451 */ 452 uint8_t mesh_configuration_client_send_netkey_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 453 454 /** 455 * @brief Add a AppKey to a AppKey List on a node. 456 * @param mesh_model 457 * @param dest element_address 458 * @param netkey_index 459 * @param appkey_index 460 * @param netk_index 461 * @param appk_index 462 * @param appkey 463 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 464 */ 465 uint8_t mesh_configuration_client_send_appkey_add(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index, uint16_t appk_index, uint8_t * appkey); 466 467 /** 468 * @brief Update AppKey in a AppKey List on a node. 469 * @param mesh_model 470 * @param dest element_address 471 * @param netkey_index 472 * @param appkey_index 473 * @param netk_index 474 * @param appk_index 475 * @param appkey 476 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 477 */ 478 uint8_t mesh_configuration_client_send_appkey_update(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index, uint16_t appk_index, uint8_t * appkey); 479 480 /** 481 * @brief Delete a AppKey from a AppKey List on a node. 482 * @param mesh_model 483 * @param dest element_address 484 * @param netkey_index 485 * @param appkey_index 486 * @param netk_index 487 * @param appk_index 488 * @param index 489 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 490 */ 491 uint8_t mesh_configuration_client_send_appkey_delete(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index, uint16_t appk_index); 492 493 /** 494 * @brief Get AppKey List on a node that is bound to the NetKey. 495 * @param mesh_model 496 * @param dest element_address 497 * @param netkey_index 498 * @param appkey_index 499 * @param netk_index 500 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 501 */ 502 uint8_t mesh_configuration_client_send_appkey_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index); 503 504 /** 505 * @brief Get the current Node Identity state for a subnet. 506 * @param mesh_model 507 * @param dest element_address 508 * @param netkey_index 509 * @param appkey_index 510 * @param netk_index 511 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 512 */ 513 uint8_t mesh_configuration_client_send_node_identity_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index); 514 515 /** 516 * @brief Set the current Node Identity state for a subnet. 517 * @param mesh_model 518 * @param dest element_address 519 * @param netkey_index 520 * @param appkey_index 521 * @param netk_index 522 * @param node_identity_state 523 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 524 */ 525 uint8_t mesh_configuration_client_send_node_identity_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index, mesh_node_identity_state_t node_identity_state); 526 527 /** 528 * @brief Bind an AppKey to a model. 529 * @param mesh_model 530 * @param dest element_address 531 * @param netkey_index 532 * @param appkey_index 533 * @param appk_index 534 * @param model_identifier 535 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 536 */ 537 uint8_t mesh_configuration_client_send_model_app_bind_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t appk_index, uint32_t model_identifier); 538 539 /** 540 * @brief Remove the binding between an AppKey and a model. 541 * @param mesh_model 542 * @param dest element_address 543 * @param netkey_index 544 * @param appkey_index 545 * @param appk_index 546 * @param model_identifier 547 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 548 */ 549 uint8_t mesh_configuration_client_send_model_app_unbind_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t appk_index, uint32_t model_identifier); 550 551 /** 552 * @brief Report of all AppKeys bound to the Model. 553 * @param mesh_model 554 * @param dest element_address 555 * @param netkey_index 556 * @param appkey_index 557 * @param model_identifier 558 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 559 */ 560 uint8_t mesh_configuration_client_send_model_app_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint32_t model_identifier); 561 562 /** 563 * @brief Reset a node (other than a Provisioner) and remove it from the network. 564 * @param mesh_model 565 * @param dest element_address 566 * @param netkey_index 567 * @param appkey_index 568 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 569 */ 570 uint8_t mesh_configuration_client_send_node_reset(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 571 572 /** 573 * @brief Get the current Friend state of a node. 574 * @param mesh_model 575 * @param dest element_address 576 * @param netkey_index 577 * @param appkey_index 578 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 579 */ 580 uint8_t mesh_configuration_client_send_friend_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 581 582 /** 583 * @brief Set the current Friend state of a node. 584 * @param mesh_model 585 * @param dest element_address 586 * @param netkey_index 587 * @param appkey_index 588 * @param friend_state 589 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 590 */ 591 uint8_t mesh_configuration_client_send_friend_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, mesh_friend_state_t friend_state); 592 593 /** 594 * @brief Get the current Key Refresh Phase state of the identified network key 595 * @param mesh_model 596 * @param dest element_address 597 * @param netkey_index 598 * @param appkey_index 599 * @param netk_index 600 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 601 */ 602 uint8_t mesh_configuration_client_send_key_refresh_phase_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index); 603 604 /** 605 * @brief Set the current Key Refresh Phase state of the identified network key 606 * @param mesh_model 607 * @param dest element_address 608 * @param netkey_index 609 * @param appkey_index 610 * @param netk_index 611 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 612 */ 613 uint8_t mesh_configuration_client_send_key_refresh_phase_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t netk_index, uint8_t transition); 614 615 /** 616 * @brief Get the current Heartbeat Publication state of an element. 617 * @param mesh_model 618 * @param dest element_address 619 * @param netkey_index 620 * @param appkey_index 621 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 622 */ 623 uint8_t mesh_configuration_client_send_heartbeat_publication_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 624 625 /** 626 * @brief Set the current Heartbeat Publication state of an element. 627 * @param mesh_model 628 * @param dest element_address 629 * @param netkey_index 630 * @param appkey_index 631 * @param publication_state 632 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 633 */ 634 uint8_t mesh_configuration_client_send_heartbeat_publication_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, mesh_heartbeat_publication_state_t publication_state); 635 636 /** 637 * @brief Get the current Heartbeat Subscription state of an element. 638 * @param mesh_model 639 * @param dest element_address 640 * @param netkey_index 641 * @param appkey_index 642 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 643 */ 644 uint8_t mesh_configuration_client_send_heartbeat_subscription_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 645 646 /** 647 * @brief Set the current Heartbeat Subscription state of an element. 648 * @param mesh_model 649 * @param dest element_address 650 * @param netkey_index 651 * @param appkey_index 652 * @param heartbeat_source 653 * @param heartbeat_destination 654 * @param period_s 655 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 656 */ 657 uint8_t mesh_configuration_client_send_heartbeat_subscription_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint16_t heartbeat_source, uint16_t heartbeat_destination, uint16_t period_s); 658 659 /** 660 * @brief Get the current value of PollTimeout timer of the Low Power node within a Friend node. 661 * @param mesh_model 662 * @param dest element_address 663 * @param netkey_index 664 * @param appkey_index 665 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 666 */ 667 uint8_t mesh_configuration_client_send_low_power_node_poll_timeout_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 668 669 /** 670 * @brief Get the current Network Transmit state of a node. 671 * @param mesh_model 672 * @param dest element_address 673 * @param netkey_index 674 * @param appkey_index 675 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 676 */ 677 uint8_t mesh_configuration_client_send_network_transmit_get(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index); 678 679 /** 680 * @brief Set the current Network Transmit state of a node. 681 * @param mesh_model 682 * @param dest element_address 683 * @param netkey_index 684 * @param appkey_index 685 * @param transmit_count 686 * @param transmit_interval_steps_ms 687 * @return status ERROR_CODE_SUCCESS if successful, otherwise BTSTACK_MEMORY_ALLOC_FAILED or ERROR_CODE_PARAMETER_OUT_OF_MANDATORY_RANGE 688 */ 689 uint8_t mesh_configuration_client_send_network_transmit_set(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t transmit_count, uint16_t transmit_interval_steps_ms); 690 691 692 #ifdef __cplusplus 693 } /* end of extern "C" */ 694 #endif 695 696 #endif 697