|
#define | BUILDING_BTDYNAMIC |
|
#define | BD_ADDR_LEN 6 |
|
#define | LINK_KEY_LEN 16 |
|
#define | DEVICE_NAME_LEN 248 |
|
#define | BTDIMPORT |
|
#define | HCI_COMMAND_DATA_PACKET 0x01 |
|
#define | HCI_ACL_DATA_PACKET 0x02 |
|
#define | HCI_SCO_DATA_PACKET 0x03 |
|
#define | HCI_EVENT_PACKET 0x04 |
|
#define | DAEMON_EVENT_PACKET 0x05 |
|
#define | L2CAP_DATA_PACKET 0x06 |
|
#define | RFCOMM_DATA_PACKET 0x07 |
|
#define | ATT_DATA_PACKET 0x08 |
|
#define | SM_DATA_PACKET 0x09 |
|
#define | LOG_MESSAGE_PACKET 0xFC |
|
#define | PSM_SDP 0x01 |
|
#define | PSM_RFCOMM 0x03 |
|
#define | PSM_HID_CONTROL 0x11 |
|
#define | PSM_HID_INTERRUPT 0x13 |
|
#define | HCI_EVENT_INQUIRY_COMPLETE 0x01 |
|
#define | HCI_EVENT_INQUIRY_RESULT 0x02 |
|
#define | HCI_EVENT_CONNECTION_COMPLETE 0x03 |
|
#define | HCI_EVENT_CONNECTION_REQUEST 0x04 |
|
#define | HCI_EVENT_DISCONNECTION_COMPLETE 0x05 |
|
#define | HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT 0x06 |
|
#define | HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE 0x07 |
|
#define | HCI_EVENT_ENCRYPTION_CHANGE 0x08 |
|
#define | HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE 0x09 |
|
#define | HCI_EVENT_MASTER_LINK_KEY_COMPLETE 0x0A |
|
#define | HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE 0x0B |
|
#define | HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0C |
|
#define | HCI_EVENT_QOS_SETUP_COMPLETE 0x0D |
|
#define | HCI_EVENT_COMMAND_COMPLETE 0x0E |
|
#define | HCI_EVENT_COMMAND_STATUS 0x0F |
|
#define | HCI_EVENT_HARDWARE_ERROR 0x10 |
|
#define | HCI_EVENT_FLUSH_OCCURED 0x11 |
|
#define | HCI_EVENT_ROLE_CHANGE 0x12 |
|
#define | HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS 0x13 |
|
#define | HCI_EVENT_MODE_CHANGE_EVENT 0x14 |
|
#define | HCI_EVENT_RETURN_LINK_KEYS 0x15 |
|
#define | HCI_EVENT_PIN_CODE_REQUEST 0x16 |
|
#define | HCI_EVENT_LINK_KEY_REQUEST 0x17 |
|
#define | HCI_EVENT_LINK_KEY_NOTIFICATION 0x18 |
|
#define | HCI_EVENT_DATA_BUFFER_OVERFLOW 0x1A |
|
#define | HCI_EVENT_MAX_SLOTS_CHANGED 0x1B |
|
#define | HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE 0x1C |
|
#define | HCI_EVENT_PACKET_TYPE_CHANGED 0x1D |
|
#define | HCI_EVENT_INQUIRY_RESULT_WITH_RSSI 0x22 |
|
#define | HCI_EVENT_EXTENDED_INQUIRY_RESPONSE 0x2F |
|
#define | HCI_EVENT_LE_META 0x3E |
|
#define | HCI_EVENT_VENDOR_SPECIFIC 0xFF |
|
#define | HCI_SUBEVENT_LE_CONNECTION_COMPLETE 0x01 |
|
#define | HCI_SUBEVENT_LE_ADVERTISING_REPORT 0x02 |
|
#define | HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE 0x03 |
|
#define | HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE 0x04 |
|
#define | HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST 0x05 |
|
#define | BTSTACK_EVENT_STATE 0x60 |
|
#define | BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0x61 |
|
#define | BTSTACK_EVENT_POWERON_FAILED 0x62 |
|
#define | BTSTACK_EVENT_VERSION 0x63 |
|
#define | BTSTACK_EVENT_SYSTEM_BLUETOOTH_ENABLED 0x64 |
|
#define | BTSTACK_EVENT_REMOTE_NAME_CACHED 0x65 |
|
#define | BTSTACK_EVENT_DISCOVERABLE_ENABLED 0x66 |
|
#define | L2CAP_EVENT_CHANNEL_OPENED 0x70 |
|
#define | L2CAP_EVENT_CHANNEL_CLOSED 0x71 |
|
#define | L2CAP_EVENT_INCOMING_CONNECTION 0x72 |
|
#define | L2CAP_EVENT_TIMEOUT_CHECK 0x73 |
|
#define | L2CAP_EVENT_CREDITS 0x74 |
|
#define | L2CAP_EVENT_SERVICE_REGISTERED 0x75 |
|
#define | RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE 0x80 |
|
#define | RFCOMM_EVENT_CHANNEL_CLOSED 0x81 |
|
#define | RFCOMM_EVENT_INCOMING_CONNECTION 0x82 |
|
#define | RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83 |
|
#define | RFCOMM_EVENT_CREDITS 0x84 |
|
#define | RFCOMM_EVENT_SERVICE_REGISTERED 0x85 |
|
#define | RFCOMM_EVENT_PERSISTENT_CHANNEL 0x86 |
|
#define | SDP_SERVICE_REGISTERED 0x90 |
|
#define | BTSTACK_CONNECTION_TO_BTDAEMON_FAILED 0x50 |
|
#define | BTSTACK_ACTIVATION_FAILED_SYSTEM_BLUETOOTH 0x51 |
|
#define | BTSTACK_ACTIVATION_POWERON_FAILED 0x52 |
|
#define | BTSTACK_ACTIVATION_FAILED_UNKNOWN 0x53 |
|
#define | BTSTACK_NOT_ACTIVATED 0x54 |
|
#define | BTSTACK_BUSY 0x55 |
|
#define | BTSTACK_MEMORY_ALLOC_FAILED 0x56 |
|
#define | BTSTACK_ACL_BUFFERS_FULL 0x57 |
|
#define | L2CAP_COMMAND_REJECT_REASON_COMMAND_NOT_UNDERSTOOD 0x60 |
|
#define | L2CAP_COMMAND_REJECT_REASON_SIGNALING_MTU_EXCEEDED 0x61 |
|
#define | L2CAP_COMMAND_REJECT_REASON_INVALID_CID_IN_REQUEST 0x62 |
|
#define | L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL 0x63 |
|
#define | L2CAP_CONNECTION_RESPONSE_RESULT_PENDING 0x64 |
|
#define | L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM 0x65 |
|
#define | L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_SECURITY 0x66 |
|
#define | L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_RESOURCES 0x65 |
|
#define | L2CAP_CONFIG_RESPONSE_RESULT_SUCCESSFUL 0x66 |
|
#define | L2CAP_CONFIG_RESPONSE_RESULT_UNACCEPTABLE_PARAMS 0x67 |
|
#define | L2CAP_CONFIG_RESPONSE_RESULT_REJECTED 0x68 |
|
#define | L2CAP_CONFIG_RESPONSE_RESULT_UNKNOWN_OPTIONS 0x69 |
|
#define | L2CAP_SERVICE_ALREADY_REGISTERED 0x6a |
|
#define | RFCOMM_MULTIPLEXER_STOPPED 0x70 |
|
#define | RFCOMM_CHANNEL_ALREADY_REGISTERED 0x71 |
|
#define | RFCOMM_NO_OUTGOING_CREDITS 0x72 |
|
#define | SDP_HANDLE_ALREADY_REGISTERED 0x80 |
|
#define | HCI_INQUIRY_LAP 0x9E8B33L |
|
#define | READ_BT_16(buffer, pos) ( ((uint16_t) buffer[pos]) | (((uint16_t)buffer[pos+1]) << 8)) |
|
#define | READ_BT_24(buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[pos+1]) << 8) | (((uint32_t)buffer[pos+2]) << 16)) |
|
#define | READ_BT_32(buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[pos+1]) << 8) | (((uint32_t)buffer[pos+2]) << 16) | (((uint32_t) buffer[pos+3])) << 24) |
|
#define | READ_NET_16(buffer, pos) ( ((uint16_t) buffer[pos+1]) | (((uint16_t)buffer[pos ]) << 8)) |
|
#define | READ_NET_32(buffer, pos) ( ((uint32_t) buffer[pos+3]) | (((uint32_t)buffer[pos+2]) << 8) | (((uint32_t)buffer[pos+1]) << 16) | (((uint32_t) buffer[pos])) << 24) |
|
#define | READ_CMD_OGF(buffer) (buffer[1] >> 2) |
|
#define | READ_CMD_OCF(buffer) ((buffer[1] & 0x03) << 8 | buffer[0]) |
|
#define | COMMAND_COMPLETE_EVENT(event, cmd) ( event[0] == HCI_EVENT_COMMAND_COMPLETE && READ_BT_16(event,3) == cmd.opcode) |
|
#define | COMMAND_STATUS_EVENT(event, cmd) ( event[0] == HCI_EVENT_COMMAND_STATUS && READ_BT_16(event,4) == cmd.opcode) |
|
#define | OFFSET_OF_DATA_IN_COMMAND_COMPLETE 5 |
|
#define | READ_ACL_CONNECTION_HANDLE(buffer) ( READ_BT_16(buffer,0) & 0x0fff) |
|
#define | READ_ACL_FLAGS(buffer) ( buffer[1] >> 4 ) |
|
#define | READ_ACL_LENGTH(buffer) (READ_BT_16(buffer, 2)) |
|
#define | READ_L2CAP_LENGTH(buffer) ( READ_BT_16(buffer, 4)) |
|
#define | READ_L2CAP_CHANNEL_ID(buffer) ( READ_BT_16(buffer, 6)) |
|
#define | BD_ADDR_CMP(a, b) memcmp(a,b, BD_ADDR_LEN) |
|
#define | BD_ADDR_COPY(dest, src) memcpy(dest,src,BD_ADDR_LEN) |
|
#define | BTSTACK_PORT 13333 |
|
#define | BTSTACK_UNIX "/tmp/BTstack" |
|
#define | GRAB(A) {#A, (void**)&A##_ptr} |
|
|
void | linked_item_set_user (linked_item_t *item, void *user_data) |
|
void * | linked_item_get_user (linked_item_t *item) |
|
int | linked_list_empty (linked_list_t *list) |
|
void | linked_list_add (linked_list_t *list, linked_item_t *item) |
|
void | linked_list_add_tail (linked_list_t *list, linked_item_t *item) |
|
int | linked_list_remove (linked_list_t *list, linked_item_t *item) |
|
linked_item_t * | linked_list_get_last_item (linked_list_t *list) |
|
void | test_linked_list (void) |
|
void | run_loop_set_timer (timer_source_t *a, uint32_t timeout_in_ms) |
|
void | run_loop_set_timer_handler (timer_source_t *ts, void(*process)(timer_source_t *_ts)) |
|
void | run_loop_add_timer (timer_source_t *timer) |
|
int | run_loop_remove_timer (timer_source_t *timer) |
|
void | run_loop_init (RUN_LOOP_TYPE type) |
|
void | run_loop_set_data_source_handler (data_source_t *ds, int(*process)(data_source_t *_ds)) |
|
void | run_loop_add_data_source (data_source_t *dataSource) |
|
int | run_loop_remove_data_source (data_source_t *dataSource) |
|
void | run_loop_execute (void) |
|
void | bt_store_16 (uint8_t *buffer, uint16_t pos, uint16_t value) |
|
void | bt_store_32 (uint8_t *buffer, uint16_t pos, uint32_t value) |
|
void | bt_flip_addr (bd_addr_t dest, bd_addr_t src) |
|
void | net_store_16 (uint8_t *buffer, uint16_t pos, uint16_t value) |
|
void | net_store_32 (uint8_t *buffer, uint16_t pos, uint32_t value) |
|
void | hexdump (void *data, int size) |
|
void | printUUID (uint8_t *uuid) |
|
void | print_bd_addr (bd_addr_t addr) |
|
char * | bd_addr_to_str (bd_addr_t addr) |
|
int | sscan_bd_addr (uint8_t *addr_string, bd_addr_t addr) |
|
uint8_t | crc8_check (uint8_t *data, uint16_t len, uint8_t check_sum) |
|
uint8_t | crc8_calc (uint8_t *data, uint16_t len) |
|
void | bt_use_tcp (const char *address, uint16_t port) |
|
int | bt_open (void) |
|
int | bt_close (void) |
|
int | bt_send_cmd (const hci_cmd_t *cmd,...) |
|
btstack_packet_handler_t | bt_register_packet_handler (btstack_packet_handler_t handler) |
|
void | bt_send_acl (uint8_t *data, uint16_t len) |
|
void | bt_send_l2cap (uint16_t local_cid, uint8_t *data, uint16_t len) |
|
void | bt_send_rfcomm (uint16_t rfcom_cid, uint8_t *data, uint16_t len) |
|
static void * | btstack_get_handle (void) |
|
static void | btpad_increment_position (uint32_t *ptr) |
|
static void | btpad_connection_send_control (void *data, uint8_t *data_buf, size_t size) |
|
static void | btpad_queue_process_cmd (struct btpad_queue_command *cmd) |
|
static void | btpad_queue_process (void) |
|
static void | btpad_queue_run (uint32_t count) |
|
static void | btpad_queue_hci_read_bd_addr (struct btpad_queue_command *cmd) |
|
static void | btpad_queue_hci_disconnect (struct btpad_queue_command *cmd, uint16_t handle, uint8_t reason) |
|
static void | btpad_queue_hci_inquiry (struct btpad_queue_command *cmd, uint32_t lap, uint8_t length, uint8_t num_responses) |
|
static void | btpad_queue_hci_remote_name_request (struct btpad_queue_command *cmd, bd_addr_t bd_addr, uint8_t page_scan_repetition_mode, uint8_t reserved, uint16_t clock_offset) |
|
static void | btpad_queue_hci_pin_code_request_reply (struct btpad_queue_command *cmd, bd_addr_t bd_addr, bd_addr_t pin) |
|
static void | btpad_close_connection (struct btstack_hid_adapter *connection) |
|
static void | btpad_close_all_connections (void) |
|
static struct btstack_hid_adapter * | btpad_find_empty_connection (void) |
|
static struct btstack_hid_adapter * | btpad_find_connection_for (uint16_t handle, bd_addr_t address) |
|
static void | btpad_queue_reset (void) |
|
static void | btpad_queue_btstack_set_power_mode (struct btpad_queue_command *cmd, uint8_t on) |
|
static void | btpad_set_inquiry_state (bool on) |
|
static void | btpad_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) |
|
static bool | btstack_try_load (void) |
|
static void | btstack_thread_stop (void *data) |
|
static void | btstack_thread_func (void *data) |
|
static void | btstack_set_poweron (bool on) |
|
static bool | btstack_hid_joypad_query (void *data, unsigned pad) |
|
static const char * | btstack_hid_joypad_name (void *data, unsigned pad) |
|
static void | btstack_hid_joypad_get_buttons (void *data, unsigned port, input_bits_t *state) |
|
static bool | btstack_hid_joypad_button (void *data, unsigned port, uint16_t joykey) |
|
static bool | btstack_hid_joypad_rumble (void *data, unsigned pad, enum retro_rumble_effect effect, uint16_t strength) |
|
static int16_t | btstack_hid_joypad_axis (void *data, unsigned port, uint32_t joyaxis) |
|
static void | btstack_hid_free (const void *data) |
|
static void * | btstack_hid_init (void) |
|
static void | btstack_hid_poll (void *data) |
|