1f4854a5eSMatthias Ringwald /* 2f4854a5eSMatthias Ringwald * Copyright (C) 2019 BlueKitchen GmbH 3f4854a5eSMatthias Ringwald * 4f4854a5eSMatthias Ringwald * Redistribution and use in source and binary forms, with or without 5f4854a5eSMatthias Ringwald * modification, are permitted provided that the following conditions 6f4854a5eSMatthias Ringwald * are met: 7f4854a5eSMatthias Ringwald * 8f4854a5eSMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 9f4854a5eSMatthias Ringwald * notice, this list of conditions and the following disclaimer. 10f4854a5eSMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 11f4854a5eSMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 12f4854a5eSMatthias Ringwald * documentation and/or other materials provided with the distribution. 13f4854a5eSMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 14f4854a5eSMatthias Ringwald * contributors may be used to endorse or promote products derived 15f4854a5eSMatthias Ringwald * from this software without specific prior written permission. 16f4854a5eSMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 17f4854a5eSMatthias Ringwald * personal benefit and not for any commercial purpose or for 18f4854a5eSMatthias Ringwald * monetary gain. 19f4854a5eSMatthias Ringwald * 20f4854a5eSMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21f4854a5eSMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22f4854a5eSMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23f4854a5eSMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 24f4854a5eSMatthias Ringwald * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25f4854a5eSMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26f4854a5eSMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27f4854a5eSMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28f4854a5eSMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29f4854a5eSMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30f4854a5eSMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31f4854a5eSMatthias Ringwald * SUCH DAMAGE. 32f4854a5eSMatthias Ringwald * 33f4854a5eSMatthias Ringwald * Please inquire about commercial licensing options at 34f4854a5eSMatthias Ringwald * [email protected] 35f4854a5eSMatthias Ringwald * 36f4854a5eSMatthias Ringwald */ 37f4854a5eSMatthias Ringwald 38f4854a5eSMatthias Ringwald #ifndef __MESH_HEALTH_SERVER_H 39f4854a5eSMatthias Ringwald #define __MESH_HEALTH_SERVER_H 40f4854a5eSMatthias Ringwald 41f4854a5eSMatthias Ringwald #include <stdint.h> 42f4854a5eSMatthias Ringwald 43f4854a5eSMatthias Ringwald #include "mesh/mesh_access.h" 44f4854a5eSMatthias Ringwald 45f4854a5eSMatthias Ringwald #ifdef __cplusplus 46f4854a5eSMatthias Ringwald extern "C" 47f4854a5eSMatthias Ringwald { 48f4854a5eSMatthias Ringwald #endif 49f4854a5eSMatthias Ringwald 50f4854a5eSMatthias Ringwald const mesh_operation_t * mesh_health_server_get_operations(void); 51f4854a5eSMatthias Ringwald 52859ea319SMilanka Ringwald /** 53859ea319SMilanka Ringwald * @brief Register packet handler 549c00e169SMatthias Ringwald * @param mesh_model for health server 55859ea319SMilanka Ringwald * @param events_packet_handler 56859ea319SMilanka Ringwald */ 57859ea319SMilanka Ringwald void mesh_health_server_register_packet_handler(mesh_model_t *mesh_model, btstack_packet_handler_t events_packet_handler); 58859ea319SMilanka Ringwald 59204019bbSMatthias Ringwald /** 60e222865bSMatthias Ringwald * @brief Setup model publication for health state 61e222865bSMatthias Ringwald * @param mesh_model for health server 62e222865bSMatthias Ringwald * @param publication_model 63e222865bSMatthias Ringwald */ 64e222865bSMatthias Ringwald void mesh_health_server_set_publication_model(mesh_model_t * mesh_model, mesh_publication_model_t * publication_model); 65e222865bSMatthias Ringwald 66e222865bSMatthias Ringwald /** 67*13dcd34bSMatthias Ringwald * @brief Notify health server that test was perfomed, params are from MESH_SUBEVENT_HEALTH_PERFORM_TEST 68*13dcd34bSMatthias Ringwald * @param dest 69*13dcd34bSMatthias Ringwald * @param netkey_index 70*13dcd34bSMatthias Ringwald * @param appkey_index 71*13dcd34bSMatthias Ringwald * @param test_id 72*13dcd34bSMatthias Ringwald * @param company_id 73204019bbSMatthias Ringwald */ 74*13dcd34bSMatthias Ringwald void mesh_health_server_report_test_done(uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t test_id, uint16_t company_id); 75859ea319SMilanka Ringwald 769c00e169SMatthias Ringwald /** 77*13dcd34bSMatthias Ringwald * @brief Notify health server that test is not supported (wrong company or test id), params are from MESH_SUBEVENT_HEALTH_PERFORM_TEST 78*13dcd34bSMatthias Ringwald * @param dest 79*13dcd34bSMatthias Ringwald * @param netkey_index 80*13dcd34bSMatthias Ringwald * @param appkey_index 81*13dcd34bSMatthias Ringwald * @param test_id 82*13dcd34bSMatthias Ringwald * @param company_id 838c3235abSMatthias Ringwald */ 84*13dcd34bSMatthias Ringwald void mesh_health_server_report_test_not_supported(uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t test_id, uint16_t company_id); 858c3235abSMatthias Ringwald 868c3235abSMatthias Ringwald /** 879c00e169SMatthias Ringwald * @brief Provide fault state memory 889c00e169SMatthias Ringwald * @param mesh_model for health server 899c00e169SMatthias Ringwald * @param company_id 909c00e169SMatthias Ringwald * @param fault_state 919c00e169SMatthias Ringwald */ 92a98de363SMatthias Ringwald void mesh_health_server_add_fault_state(mesh_model_t *mesh_model, uint16_t company_id, mesh_health_fault_t * fault_state); 939c00e169SMatthias Ringwald 949c00e169SMatthias Ringwald /* 959c00e169SMatthias Ringwald * @brief Set fault 969c00e169SMatthias Ringwald * @param mesh_model for health server 979c00e169SMatthias Ringwald * @param company_id 989c00e169SMatthias Ringwald * @param fault_code 999c00e169SMatthias Ringwald */ 1009c00e169SMatthias Ringwald void mesh_health_server_set_fault(mesh_model_t *mesh_model, uint16_t company_id, uint8_t fault_code); 1019c00e169SMatthias Ringwald 1029c00e169SMatthias Ringwald /* 1039c00e169SMatthias Ringwald * @brief Clear fault 1049c00e169SMatthias Ringwald * @param mesh_model for health server 1059c00e169SMatthias Ringwald * @param company_id 1069c00e169SMatthias Ringwald * @param fault_code 1079c00e169SMatthias Ringwald */ 1089c00e169SMatthias Ringwald void mesh_health_server_clear_fault(mesh_model_t *mesh_model, uint16_t company_id, uint8_t fault_code); 1099c00e169SMatthias Ringwald 1109c00e169SMatthias Ringwald 111f4854a5eSMatthias Ringwald #ifdef __cplusplus 112f4854a5eSMatthias Ringwald } /* end of extern "C" */ 113f4854a5eSMatthias Ringwald #endif 114f4854a5eSMatthias Ringwald 115f4854a5eSMatthias Ringwald #endif 116