1 /** 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 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 * Description: SLE OTA service. 15 */ 16 17 #ifndef SLE_OTA_H 18 #define SLE_OTA_H 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /** 25 * @defgroup sle_ota API 26 * @ingroup SLE 27 * @{ 28 */ 29 30 /** 31 * @if Eng 32 * @brief SLE ota server init. 33 * @attention NULL 34 * @retval ERRCODE_SUCC Success 35 * @retval Other Failure,For details, see @ref errcode_t 36 * @par Dependency: 37 * @li sle_ssap_server.h 38 * @else 39 * @brief SLE OTA服务器初始化。 40 * @attention NULL 41 * @retval ERRCODE_SUCC 成功 42 * @retval Other 失败,参考 @ref errcode_t 43 * @par 依赖: 44 * @li sle_ssap_server.h 45 * @endif 46 */ 47 errcode_t sle_ota_service_init(uint8_t server_id); 48 49 /** 50 * @if Eng 51 * @brief SLE ota server send data ack. 52 * @attention NULL 53 * @retval ERRCODE_SUCC Success 54 * @retval Other Failure,For details, see @ref errcode_t 55 * @par Dependency: 56 * @li sle_ssap_server.h 57 * @else 58 * @brief SLE OTA服务器发送数据ack。 59 * @attention NULL 60 * @retval ERRCODE_SUCC 成功 61 * @retval Other 失败,参考 @ref errcode_t 62 * @par 依赖: 63 * @li sle_ssap_server.h 64 * @endif 65 */ 66 errcode_t sle_ota_data_ack(uint16_t value_len, uint8_t *value); 67 68 /** 69 * @if Eng 70 * @brief Definition of Data Obtaining and Invoking for general using. 71 * @param [in] data_ptr data. 72 * @param [in] data_len data length. 73 * @retval error code. 74 * @else 75 * @brief 通用获取数据回调定义。 76 * @param [in] data_ptr 数据。 77 * @param [in] data_len 数据长度。 78 * @retval error code. 79 * @endif 80 */ 81 typedef void (*sle_ota_chan_data_report) (const uint8_t *data_ptr, const uint16_t data_len); 82 83 /** 84 * @if Eng 85 * @brief Callback function for server to receive ota data. 86 * @else 87 * @brief 服务端接收ota升级数据回调。 88 * @endif 89 */ 90 void sle_ota_reg_chan_data_report_cbk(sle_ota_chan_data_report data_report); 91 92 #ifdef __cplusplus 93 } 94 #endif 95 #endif /* SLE_SRV_OTA_H */ 96 97 /** 98 * @} 99 */