1 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
2 //
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  * common/bt_defs.h    Defines useful API for whole Bluedroid
17  *
18  */
19 #ifndef _BT_DEFS_H_
20 #define _BT_DEFS_H_
21 
22 #include <stdlib.h>
23 #include <stdint.h>
24 #include <arpa/inet.h>
25 #include "bt_common.h"
26 #include "common/bt_target.h"
27 
28 #define UNUSED(x)                   (void)(x)
29 
30 /*Timer Related Defination*/
31 
32 //by Snake.T
33 typedef void (TIMER_CBACK)(void *p_tle);
34 typedef struct _tle {
35     struct _tle  *p_next;
36     struct _tle  *p_prev;
37     TIMER_CBACK  *p_cback;
38     INT32         ticks;
39     INT32         ticks_initial;
40     TIMER_PARAM_TYPE   param;
41     TIMER_PARAM_TYPE   data;
42     UINT16        event;
43     UINT8         in_use;
44 } TIMER_LIST_ENT;
45 
46 #define alarm_timer_t               uint32_t
47 #define alarm_timer_setfn(timer, cb, data)           \
48 do {                                                 \
49 } while (0)
50 #define alarm_timer_arm(timer, to, periodic)         \
51 do {                                                 \
52 } while (0)
53 #define alarm_timer_disarm(timer)                    \
54 do {                                                 \
55 } while (0)
56 #define alarm_timer_now()             (0)
57 
58 
59 /*Bluetooth Address*/
60 typedef struct {
61     uint8_t address[6];
62 } __attribute__ ((__packed__)) bt_bdaddr_t;
63 
64 /** Bluetooth 128-bit UUID */
65 typedef struct {
66     uint8_t uu[16];
67 } bt_uuid_t;
68 
69 #ifndef CPU_LITTLE_ENDIAN
70 #define CPU_LITTLE_ENDIAN
71 #endif
72 
73 #endif /* _BT_DEFS_H_ */
74