1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
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 BTM_THREAD_H
17 #define BTM_THREAD_H
18 
19 #include "thread.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 void BtmInitThread();
26 void BtmCloseThread();
27 
28 Thread *BTM_GetProcessingThread();
29 
30 #define BTM_PROCESSING_QUEUE_SIZE_DEFAULT 128
31 
32 #define PROCESSING_QUEUE_ID_BTM 0
33 #define PROCESSING_QUEUE_ID_HCI 1
34 #define PROCESSING_QUEUE_ID_LA2CAP 2
35 #define PROCESSING_QUEUE_ID_GAP 3
36 #define PROCESSING_QUEUE_ID_RFCOMM 4
37 #define PROCESSING_QUEUE_ID_ATT 5
38 #define PROCESSING_QUEUE_ID_AVCTP 6
39 #define PROCESSING_QUEUE_ID_AVDTP 7
40 #define PROCESSING_QUEUE_ID_SDP 8
41 #define PROCESSING_QUEUE_ID_SMP 9
42 
43 int BTM_CreateProcessingQueue(uint8_t queueId, uint16_t size);
44 
45 int BTM_DeleteProcessingQueue(uint8_t queueId);
46 
47 int BTM_RunTaskInProcessingQueue(uint8_t queueId, void (*task)(void *context), void *context);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif