19#ifndef BTIF_SOCK_THREAD_H
20#define BTIF_SOCK_THREAD_H
22#include <hardware/bt_sock.h>
28#define SOCK_THREAD_FD_RD 1
29#define SOCK_THREAD_FD_WR (1 << 1)
30#define SOCK_THREAD_FD_EXCEPTION (1 << 2)
31#define SOCK_THREAD_ADD_FD_SYNC (1 << 3)
38typedef void (*btsock_signaled_cb)(
int fd,
int type,
int flags, uint32_t user_id);
39typedef void (*btsock_cmd_cb)(
int cmd_fd,
int type,
int size, uint32_t user_id);
41int btsock_thread_init();
42int btsock_thread_add_fd(
int handle,
int fd,
int type,
int flags, uint32_t user_id);
43int btsock_thread_wakeup(
int handle);
44int btsock_thread_post_cmd(
int handle,
int cmd_type,
const unsigned char* cmd_data,
45 int data_size, uint32_t user_id);
46int btsock_thread_create(btsock_signaled_cb callback, btsock_cmd_cb cmd_callback);
47int btsock_thread_exit(
int handle);