• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef __APPOTABOX_H
16 #define __APPOTABOX_H
17 #include "cs_target_config.h"
18 #if PLF_BT_OTA == 1
19 #include "cs_adp_api.h"
20 
21 enum {
22     OTA_INFO_HEADER = (0x01UL << 0),
23     OTA_DATA_HEADER = (0x01UL << 1),
24 };
25 
26 enum APP_OTA_ACCESS{
27     OTA_BY_SPP = 1,
28     OTA_BY_VENDOR,
29     OTA_BY_BLE,
30 };
31 void app_ota_set_access(enum APP_OTA_ACCESS access);
32 enum APP_OTA_ACCESS app_ota_get_access(void);
33 void app_ota_init(void);
34 void app_ota_msg_handle(CS_EVENT *Event);
35 uint8_t app_ota_send_data(uint8_t *data, uint16_t len, uint8_t header);
36 void app_ota_receive_data(uint8_t *rxbuf, uint16_t len);
37 #if APP_SUPPORT_OTA_BOX
38 void app_ota_connect_device(BT_ADDR * bdaddr);
39 void app_ota_clean_addr_list(void);
40 void app_ota_connect_by_list_id(uint8_t id);
41 void app_ota_add_addr_list(BT_ADDR *ota_addr);
42 #endif
43 #endif
44 #endif
45