1 /* 2 * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef _SMARTCONFIG_TASK_H_ 17 #define _SMARTCONFIG_TASK_H_ 18 19 /** 20 **************************************************************************************** 21 * @addtogroup SMARTCONFIGTASK Task 22 * @ingroup SMARTCONFIG 23 * @brief Smart Config Profile Task. 24 * 25 * The SMARTCONFIGTASK is responsible for handling the messages coming in and out of the 26 * @ref SMARTCONFIG collector block of the BLE Host. 27 * 28 * @{ 29 **************************************************************************************** 30 */ 31 32 33 /* 34 * INCLUDE FILES 35 **************************************************************************************** 36 */ 37 #include <stdint.h> 38 #include "ble_ip_task.h" // Task definitions 39 40 /* 41 * DEFINES 42 **************************************************************************************** 43 */ 44 /// Messages for Smart Config Profile 45 enum smartconfig_msg_id 46 { 47 SMARTCONFIG_WIFI_STATE_SERVICE_CHANGED = TASK_FIRST_MSG(TASK_ID_SMARTCONFIG), 48 49 SMARTCONFIG_AP_INFO_RECEIVED, 50 51 SMARTCONFIG_SEND_WIFI_STATE_NOTIFICATION, 52 53 SMARTCONFIG_SEND_WIFI_STATE_INDICATION, 54 55 SMARTCONFIG_TIME_STATE_SERVICE_CHANGED, 56 57 SMARTCONFIG_TIME_STATE_SENT, 58 59 SMARTCONFIG_TIME_INFO_RECEIVED, 60 61 SMARTCONFIG_SEND_TIME_STATE_NOTIFICATION, 62 63 SMARTCONFIG_SEND_TIME_STATE_INDICATION, 64 }; 65 66 /* 67 * TYPE DEFINITIONS 68 **************************************************************************************** 69 */ 70 71 struct ble_smartconfig_notif_config 72 { 73 bool ntf_en; 74 }; 75 76 struct ble_smartconfig_rx_data_ind 77 { 78 /// Rx Data Length 79 uint16_t length; 80 /// Rx Data 81 uint8_t data[0]; 82 }; 83 84 struct ble_smartconfig_data_sent_ind 85 { 86 /// Status of the send indicate 87 uint8_t status; 88 }; 89 90 struct ble_smartconfig_send_data_req 91 { 92 /// Connection Index 93 uint8_t conidx; 94 /// Data Length 95 uint32_t length; 96 /// Data 97 uint8_t value[__ARRAY_EMPTY]; 98 }; 99 100 101 /// @} SMARTCONFIGTASK 102 103 #endif /* _SMARTCONFIG_TASK_H_ */ 104 105