RetroArch
Functions | Variables
hci.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <ogcsys.h>
#include <gccore.h>
#include "hci.h"
#include "l2cap.h"
#include "btmemr.h"
#include "btmemb.h"
#include "btpbuf.h"
#include "physbusif.h"
Include dependency graph for hci.c:

Functions

 MEMB (hci_pcbs, sizeof(struct hci_pcb), MEMB_NUM_HCI_PCB)
 
 MEMB (hci_links, sizeof(struct hci_link), MEMB_NUM_HCI_LINK)
 
 MEMB (hci_inq_results, sizeof(struct hci_inq_res), MEMB_NUM_HCI_INQ)
 
 MEMB (hci_link_key_results, sizeof(struct hci_link_key), MEMB_NUM_HCI_LINK_KEY)
 
err_t hci_init (void)
 
struct hci_linkhci_new (void)
 
struct hci_linkhci_get_link (struct bd_addr *bdaddr)
 
err_t hci_close (struct hci_link *link)
 
void hci_reset_all (void)
 
void hci_arg (void *arg)
 
void hci_cmd_complete (err_t(*cmd_complete)(void *arg, struct hci_pcb *pcb, u8_t ogf, u8_t ocf, u8_t result))
 
void hci_pin_req (err_t(*pin_req)(void *arg, struct bd_addr *bdaddr))
 
void hci_link_key_req (err_t(*link_key_req)(void *arg, struct bd_addr *bdaddr))
 
void hci_link_key_not (err_t(*link_key_not)(void *arg, struct bd_addr *bdaddr, u8_t *key))
 
void hci_connection_complete (err_t(*conn_complete)(void *arg, struct bd_addr *bdaddr))
 
void hci_wlp_complete (err_t(*wlp_complete)(void *arg, struct bd_addr *bdaddr))
 
void hci_conn_req (err_t(*conn_req)(void *arg, struct bd_addr *bdaddr, u8_t *cod, u8_t link_type))
 
err_t hci_reg_dev_info (struct bd_addr *bdaddr, u8_t *cod, u8_t psrm, u8_t psm, u16_t co)
 
struct pbufhci_cmd_ass (struct pbuf *p, u8_t ocf, u8_t ogf, u8_t len)
 
err_t hci_reset (void)
 
err_t hci_read_buffer_size (void)
 
err_t hci_read_bd_addr (void)
 
err_t hci_read_local_version (void)
 
err_t hci_read_local_features (void)
 
err_t hci_read_stored_link_key ()
 
err_t hci_set_event_filter (u8_t filter_type, u8_t filter_cond_type, u8_t *cond)
 
err_t hci_write_page_timeout (u16_t timeout)
 
err_t hci_write_scan_enable (u8_t scan_enable)
 
err_t hci_inquiry (u32_t lap, u8_t inq_len, u8_t num_resp, err_t(*inq_complete)(void *arg, struct hci_pcb *pcb, struct hci_inq_res *ires, u16_t result))
 
err_t hci_periodic_inquiry (u32_t lap, u16_t min_period, u16_t max_period, u8_t inq_len, u8_t num_resp, err_t(*inq_complete)(void *arg, struct hci_pcb *pcb, struct hci_inq_res *ires, u16_t result))
 
err_t hci_exit_periodic_inquiry ()
 
err_t hci_accecpt_conn_request (struct bd_addr *bdaddr, u8_t role)
 
err_t hci_set_event_mask (u64_t ev_mask)
 
err_t hci_write_local_name (u8_t *name, u8_t len)
 
err_t hci_write_pin_type (u8_t type)
 
err_t hci_read_remote_name (struct bd_addr *bdaddr)
 
err_t hci_write_inquiry_mode (u8_t mode)
 
err_t hci_write_page_scan_type (u8_t type)
 
err_t hci_write_inquiry_scan_type (u8_t type)
 
err_t hci_vendor_specific_command (u8_t ocf, u8_t ogf, void *data, u8_t len)
 
err_t hci_sniff_mode (struct bd_addr *bdaddr, u16_t max_interval, u16_t min_interval, u16_t attempt, u16_t timeout)
 
err_t hci_write_link_policy_settings (struct bd_addr *bdaddr, u16_t link_policy)
 
err_t hci_pin_code_request_reply (struct bd_addr *bdaddr, u8_t pinlen, u8_t *pincode)
 
err_t hci_link_key_req_reply (struct bd_addr *bdaddr, unsigned char *link_key)
 
err_t hci_pin_code_request_neg_reply (struct bd_addr *bdaddr)
 
err_t hci_link_key_req_neg_reply (struct bd_addr *bdaddr)
 
err_t hci_disconnect (struct bd_addr *bdaddr, u8_t reason)
 
err_t hci_reject_connection_request (struct bd_addr *bdaddr, u8_t reason)
 
err_t hci_write_stored_link_key (struct bd_addr *bdaddr, u8_t *link)
 
err_t hci_write_cod (u8_t *cod)
 
err_t hci_read_current_lap (void)
 
err_t hci_set_hc_to_h_fc (void)
 
err_t hci_host_buffer_size (void)
 
err_t hci_host_num_comp_packets (u16_t conhdl, u16_t num_complete)
 
u16_t lp_pdu_maxsize ()
 
u8_t lp_is_connected (struct bd_addr *bdaddr)
 
err_t lp_acl_write (struct bd_addr *bdaddr, struct pbuf *p, u16_t len, u8_t pb)
 
err_t lp_write_flush_timeout (struct bd_addr *bdaddr, u16_t flushto)
 
err_t lp_connect_req (struct bd_addr *bdaddr, u8_t allow_role_switch)
 
static void hci_cc_info_param (u8_t ocf, struct pbuf *p)
 
static void hci_cc_host_ctrl (u8_t ocf, struct pbuf *p)
 
static void hci_cc_link_policy (u8_t ocf, struct pbuf *p)
 
static void hci_conn_request_evt (struct pbuf *p)
 
static void hci_conn_complete_evt (struct pbuf *p)
 
static void hci_inquiry_result_evt (struct pbuf *p)
 
static void hci_return_link_key_evt (struct pbuf *p)
 
void hci_event_handler (struct pbuf *p)
 
void hci_acldata_handler (struct pbuf *p)
 

Variables

struct hci_pcbhci_dev = NULL
 
struct hci_linkhci_active_links = NULL
 
struct hci_linkhci_tmp_link = NULL
 
struct hci_link_keyhci_tmp_key = NULL
 

Function Documentation

◆ hci_accecpt_conn_request()

err_t hci_accecpt_conn_request ( struct bd_addr bdaddr,
u8_t  role 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_acldata_handler()

void hci_acldata_handler ( struct pbuf p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_arg()

void hci_arg ( void arg)
Here is the caller graph for this function:

◆ hci_cc_host_ctrl()

static void hci_cc_host_ctrl ( u8_t  ocf,
struct pbuf p 
)
static
Here is the caller graph for this function:

◆ hci_cc_info_param()

static void hci_cc_info_param ( u8_t  ocf,
struct pbuf p 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_cc_link_policy()

static void hci_cc_link_policy ( u8_t  ocf,
struct pbuf p 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_close()

err_t hci_close ( struct hci_link link)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_cmd_ass()

struct pbuf* hci_cmd_ass ( struct pbuf p,
u8_t  ocf,
u8_t  ogf,
u8_t  len 
)
Here is the caller graph for this function:

◆ hci_cmd_complete()

void hci_cmd_complete ( err_t(*)(void *arg, struct hci_pcb *pcb, u8_t ogf, u8_t ocf, u8_t result cmd_complete)
Here is the caller graph for this function:

◆ hci_conn_complete_evt()

static void hci_conn_complete_evt ( struct pbuf p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_conn_req()

void hci_conn_req ( err_t(*)(void *arg, struct bd_addr *bdaddr, u8_t *cod, u8_t link_type)  conn_req)

◆ hci_conn_request_evt()

static void hci_conn_request_evt ( struct pbuf p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_connection_complete()

void hci_connection_complete ( err_t(*)(void *arg, struct bd_addr *bdaddr)  conn_complete)
Here is the caller graph for this function:

◆ hci_disconnect()

err_t hci_disconnect ( struct bd_addr bdaddr,
u8_t  reason 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_event_handler()

void hci_event_handler ( struct pbuf p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_exit_periodic_inquiry()

err_t hci_exit_periodic_inquiry ( )
Here is the call graph for this function:

◆ hci_get_link()

struct hci_link* hci_get_link ( struct bd_addr bdaddr)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_host_buffer_size()

err_t hci_host_buffer_size ( void  )
Here is the call graph for this function:

◆ hci_host_num_comp_packets()

err_t hci_host_num_comp_packets ( u16_t  conhdl,
u16_t  num_complete 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_init()

err_t hci_init ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_inquiry()

err_t hci_inquiry ( u32_t  lap,
u8_t  inq_len,
u8_t  num_resp,
err_t(*)(void *arg, struct hci_pcb *pcb, struct hci_inq_res *ires, u16_t result inq_complete 
)
Here is the call graph for this function:

◆ hci_inquiry_result_evt()

static void hci_inquiry_result_evt ( struct pbuf p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_link_key_not()

void hci_link_key_not ( err_t(*)(void *arg, struct bd_addr *bdaddr, u8_t *key)  link_key_not)
Here is the call graph for this function:

◆ hci_link_key_req()

void hci_link_key_req ( err_t(*)(void *arg, struct bd_addr *bdaddr)  link_key_req)

◆ hci_link_key_req_neg_reply()

err_t hci_link_key_req_neg_reply ( struct bd_addr bdaddr)
Here is the call graph for this function:

◆ hci_link_key_req_reply()

err_t hci_link_key_req_reply ( struct bd_addr bdaddr,
unsigned char *  link_key 
)
Here is the call graph for this function:

◆ hci_new()

struct hci_link* hci_new ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_periodic_inquiry()

err_t hci_periodic_inquiry ( u32_t  lap,
u16_t  min_period,
u16_t  max_period,
u8_t  inq_len,
u8_t  num_resp,
err_t(*)(void *arg, struct hci_pcb *pcb, struct hci_inq_res *ires, u16_t result inq_complete 
)
Here is the call graph for this function:

◆ hci_pin_code_request_neg_reply()

err_t hci_pin_code_request_neg_reply ( struct bd_addr bdaddr)
Here is the call graph for this function:

◆ hci_pin_code_request_reply()

err_t hci_pin_code_request_reply ( struct bd_addr bdaddr,
u8_t  pinlen,
u8_t pincode 
)
Here is the call graph for this function:

◆ hci_pin_req()

void hci_pin_req ( err_t(*)(void *arg, struct bd_addr *bdaddr)  pin_req)
Here is the call graph for this function:

◆ hci_read_bd_addr()

err_t hci_read_bd_addr ( void  )
Here is the call graph for this function:

◆ hci_read_buffer_size()

err_t hci_read_buffer_size ( void  )
Here is the call graph for this function:

◆ hci_read_current_lap()

err_t hci_read_current_lap ( void  )
Here is the call graph for this function:

◆ hci_read_local_features()

err_t hci_read_local_features ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_read_local_version()

err_t hci_read_local_version ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_read_remote_name()

err_t hci_read_remote_name ( struct bd_addr bdaddr)
Here is the call graph for this function:

◆ hci_read_stored_link_key()

err_t hci_read_stored_link_key ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_reg_dev_info()

err_t hci_reg_dev_info ( struct bd_addr bdaddr,
u8_t cod,
u8_t  psrm,
u8_t  psm,
u16_t  co 
)
Here is the call graph for this function:

◆ hci_reject_connection_request()

err_t hci_reject_connection_request ( struct bd_addr bdaddr,
u8_t  reason 
)
Here is the call graph for this function:

◆ hci_reset()

err_t hci_reset ( void  )
Here is the call graph for this function:

◆ hci_reset_all()

void hci_reset_all ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_return_link_key_evt()

static void hci_return_link_key_evt ( struct pbuf p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_set_event_filter()

err_t hci_set_event_filter ( u8_t  filter_type,
u8_t  filter_cond_type,
u8_t cond 
)
Here is the call graph for this function:

◆ hci_set_event_mask()

err_t hci_set_event_mask ( u64_t  ev_mask)
Here is the call graph for this function:

◆ hci_set_hc_to_h_fc()

err_t hci_set_hc_to_h_fc ( void  )
Here is the call graph for this function:

◆ hci_sniff_mode()

err_t hci_sniff_mode ( struct bd_addr bdaddr,
u16_t  max_interval,
u16_t  min_interval,
u16_t  attempt,
u16_t  timeout 
)
Here is the call graph for this function:

◆ hci_vendor_specific_command()

err_t hci_vendor_specific_command ( u8_t  ocf,
u8_t  ogf,
void data,
u8_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_wlp_complete()

void hci_wlp_complete ( err_t(*)(void *arg, struct bd_addr *bdaddr)  wlp_complete)
Here is the caller graph for this function:

◆ hci_write_cod()

err_t hci_write_cod ( u8_t cod)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_write_inquiry_mode()

err_t hci_write_inquiry_mode ( u8_t  mode)
Here is the call graph for this function:

◆ hci_write_inquiry_scan_type()

err_t hci_write_inquiry_scan_type ( u8_t  type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_write_link_policy_settings()

err_t hci_write_link_policy_settings ( struct bd_addr bdaddr,
u16_t  link_policy 
)
Here is the call graph for this function:

◆ hci_write_local_name()

err_t hci_write_local_name ( u8_t name,
u8_t  len 
)
Here is the call graph for this function:

◆ hci_write_page_scan_type()

err_t hci_write_page_scan_type ( u8_t  type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_write_page_timeout()

err_t hci_write_page_timeout ( u16_t  timeout)
Here is the call graph for this function:

◆ hci_write_pin_type()

err_t hci_write_pin_type ( u8_t  type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hci_write_scan_enable()

err_t hci_write_scan_enable ( u8_t  scan_enable)
Here is the call graph for this function:

◆ hci_write_stored_link_key()

err_t hci_write_stored_link_key ( struct bd_addr bdaddr,
u8_t link 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lp_acl_write()

err_t lp_acl_write ( struct bd_addr bdaddr,
struct pbuf p,
u16_t  len,
u8_t  pb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lp_connect_req()

err_t lp_connect_req ( struct bd_addr bdaddr,
u8_t  allow_role_switch 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lp_is_connected()

u8_t lp_is_connected ( struct bd_addr bdaddr)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lp_pdu_maxsize()

u16_t lp_pdu_maxsize ( )
Here is the caller graph for this function:

◆ lp_write_flush_timeout()

err_t lp_write_flush_timeout ( struct bd_addr bdaddr,
u16_t  flushto 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MEMB() [1/4]

MEMB ( hci_pcbs  ,
sizeof(struct hci_pcb ,
MEMB_NUM_HCI_PCB   
)

◆ MEMB() [2/4]

MEMB ( hci_links  ,
sizeof(struct hci_link ,
MEMB_NUM_HCI_LINK   
)

◆ MEMB() [3/4]

MEMB ( hci_inq_results  ,
sizeof(struct hci_inq_res ,
MEMB_NUM_HCI_INQ   
)

◆ MEMB() [4/4]

MEMB ( hci_link_key_results  ,
sizeof(struct hci_link_key ,
MEMB_NUM_HCI_LINK_KEY   
)

Variable Documentation

◆ hci_active_links

struct hci_link* hci_active_links = NULL

◆ hci_dev

struct hci_pcb* hci_dev = NULL

◆ hci_tmp_key

struct hci_link_key* hci_tmp_key = NULL

◆ hci_tmp_link

struct hci_link* hci_tmp_link = NULL