• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Bestechnic (Shanghai) Co., 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 __APPS_H__
16 #define __APPS_H__
17 
18 #include "app_status_ind.h"
19 
20 #define STACK_READY_BT  0x01
21 #define STACK_READY_BLE 0x02
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include "plat_types.h"
28 
29 int app_init(int only_init);
30 
31 int app_deinit(int deinit_case);
32 
33 int app_shutdown(void);
34 
35 int app_reset(void);
36 
37 int app_status_battery_report(uint8_t level);
38 
39 int app_voice_report( APP_STATUS_INDICATION_T status,uint8_t device_id);
40 int app_voice_report_generic(APP_STATUS_INDICATION_T status, uint8_t device_id, uint8_t isMerging);
41 int app_voice_stop(APP_STATUS_INDICATION_T status, uint8_t device_id);
42 
43 void app_enter_signalingtest_mode(void);
44 void app_enter_non_signalingtest_mode(void);
45 
46 
47 /*FixME*/
48 void app_status_set_num(const char* p);
49 
50 ////////////10 second tiemr///////////////
51 #define APP_FAST_PAIRING_TIMEOUT_IN_SECOND  120
52 
53 #define APP_PAIR_TIMER_ID       0
54 #define APP_POWEROFF_TIMER_ID   1
55 #define APP_FASTPAIR_LASTING_TIMER_ID   2
56 
57 void app_stop_10_second_timer(uint8_t timer_id);
58 void app_start_10_second_timer(uint8_t timer_id);
59 
60 void app_notify_stack_ready(uint8_t ready_flag);
61 
62 void app_start_postponed_reset(void);
63 
64 bool app_is_power_off_in_progress(void);
65 
66 #define CHIP_ID_C     1
67 #define CHIP_ID_D     2
68 
69 void app_disconnect_all_bt_connections(void);
70 bool app_is_stack_ready(void);
71 
72 void app_start_power_consumption_thread(void);
73 
74 int app_init_btc(void);
75 int app_deinit_btc(int deinit_case);
76 
77 ////////////////////
78 
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 #endif//__FMDEC_H__
84