// Copyright: See COPYING file that comes with this distribution
//
//
-#ifndef __HIL2CAP
-#define __HIL2CAP
+#ifndef __TINI_BT_HCI_CORE
+#define __TINI_BT_HCI_CORE
-#include"hcidriver.h"
+#include"tiny_bt_hci_cmd.h"
#include<asm/types.h>
#include<sys/socket.h>
#include<errno.h>
DONE = 3
}req_state;
-typedef enum{
- LINUX = 0,
- UART = 1
-}hw_connection_type;
-
#define MAX_CMD_STATE_REQUEST 0x0F
#define MAX_EVT_COUNT 128
__u16 id;
__u8 evt_type;
__u16 req_opcode;
- int (*p_callback)(void *p_arg, void *p_recbuf);
+ void (*p_callback)(void *p_arg, void *p_recbuf);
void *p_data;
} __attribute__((packed)) expect_evt;
int socket_fd;
}connection_hci;
-typedef struct{
- hw_connection_type type;
- __u16 dev_identif; // like a device descriptor
- hci_dev_info dev;
-}bt_device;
-
typedef struct{
bt_address *p_address;
void (*callback_app_inquiry_RSSI)(bt_address *p_address);
}inquiry_RSSI_data;
+typedef struct{
+ void (*callback_app_inquiry_complete)(void);
+}inquiry_complete_data;
+
typedef struct{
__u16 *p_handle;
//bt_address *p_address; // address of device whoo iniciated this connection
- void (*callback_app_connection_complete)(__u16 *p_handle, bt_address *p_address);
+ void (*callback_app_connection_complete)(__u16 *p_handle);
}connection_complete_data;
-
-extern int create_master_connection(connection_hci *p_connection);
-extern int show_all_local_dev(struct hci_dev_info *master);
-extern int show_all_remote_dev(struct hci_dev_info *master, bt_address *p_remadrar,int *p_remd_count);
-
-extern int l2cap_call_cmd(__u16 ocf_ogf,int dd, void *p_param);
-
-extern int req_fcn_add(cmd_state_request *p_req);
-extern void req_fcn_remove(void);
-
-extern void *rutine_catch_bd_addr(void *arg);
-
-
-
+extern void add_evt_toarray(expect_evt *p_evt);
+extern int look_up_inarray(__u8 evt_type, __u16 opcode);
+extern int tiny_bt_init(__u8 dev_id);
+extern int tiny_bt_process();
+extern int tiny_bt_read_bd_addr(bt_address *p_dest, void(*callback_app_read_bd_addr)(bt_address *p_address));
+extern int tiny_bt_read_local_name(char *p_name, void(*callback_app_read_local_name)(char *p_name));
+extern int tiny_bt_inquiry(bt_address *p_dest_addr, void(*callback_app_inquiry_RSSI)(bt_address *p_address), void(*callback_app_inquiry_complete)(void));
+extern void tiny_bt_inquiry_register_again(bt_address *p_dest_addr, void(*callback_app_inquiry_RSSI)(bt_address *p_address));
+extern int tiny_bt_connect(bt_address *p_dest_addr, __u16 *p_handle, void( *callback_app_connection_complete)(__u16 *p_handle));
+extern int tiny_bt_wait_for_connection();
#endif