#include<asm/types.h>
#include<sys/socket.h>
-#include<bluetooth/hci.h>
#include<string.h>
+#include "hciembeded.h"
#define SOL_SCO 17
#define SOL_RFCOMM 18
+#define INQ_TIME_1s28 1
+#define INQ_TIME_2s56 2
+#define INQ_TIME_4s24 3
+#define INQ_TIME_5s52 4
+#define INQ_TIME_7s20 5
+#define INQ_TIME_14s40 10
+
+#define NUM_RSP_5 5
+#define NUM_RSP_10 10
+#define NUM_RSP_20 20
+
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
/* BD_ADDR (bluetooth.h)*/
-typedef struct{
- __u8 byte[6];
-} __attribute__((packed)) bt_address;
-typedef struct{
- uint8_t b[6];
-} __attribute__((packed)) bdaddr_t;
typedef struct{
__u8 byte[3];
/* next function structures*/
-extern int call_hci_inquiry_cmd(int dd, bt_address *p_addressarray,int timeout);
-extern int call_hci_read_bd_addr_cmd(int dd,bt_address *p_address, int timeout);
-extern int call_hci_create_connection_cmd(int dd, bt_address *p_address, int timeout);
+extern int call_hci_inquiry_cmd(int dd, void *p_addressarray,__u16 *p_ocf_ogf);
+extern int call_hci_read_bd_addr_cmd(int dd,bt_address *p_address,__u16 *p_ocf_ogf);
+extern int call_hci_read_local_name_cmd(int dd, void *p_name,__u16 *p_ocf_ogf);
+extern int call_hci_create_connection_cmd(int dd, bt_address *p_address, __u16 *p_ocf_ogf);
+extern int call_hci_accept_conn_req_cmd(int dd, bt_address *p_address, __u16 *p_ocf_ogf);
extern int hci_open_device(int dev_id);
+extern int hci_open_device_nonblock(int dev_id);
extern int hci_send_command(int dd, hci_request *p_req);
extern int hci_send_request(int dd, hci_request *p_req,int timeout);
-extern void print_device_list(int ctl);
+//extern void print_device_list(int ctl);
extern int hci_close_dev(int dd);
extern void assemble_hci_data(void *p_con_handle,void *p_data_size,void *p_data);
extern void assemble_ocf_ogf(__u8 ogf,__u8 ocf,__u16 *p_ocf_ogf);
+extern __u16 swap_2_bytes(__u16 twobytes);
extern __u8 swap8(__u8 byte1);
extern __u16 swap16(__u16 byte2);
+extern __u16 swap_2_bytes(__u16 twobytes);
//extern void bacpy(bt_address p_dest, bt_address p_source);
extern void fill_add(bt_address *addr,__u8 first, __u8 sec, __u8 third, __u8 forth, __u8 fifth, __u8 sixth);
extern void printba(bt_address *ba);