dotstack API Reference  1.10.37
Typedefs | Functions
System Functions

Functions in this module provide interface to DotStack functionality that is common to all protocols and profiles. More...

Typedefs

typedef void(* bt_sys_callback_fp) (bt_bool success, void *param)
 System start callback. More...
 

Functions

void bt_sys_init (void)
 Initialize the Bluetooth system. More...
 
void bt_sys_init_ex (bt_byte default_link_policy)
 Initialize the Bluetooth system. More...
 
void bt_sys_start (bt_bool discoverable, bt_bool connectable, const bt_byte *sdp_db, bt_uint sdp_db_len, bt_sys_callback_fp callback, void *callback_param)
 Start the Bluetooth system. More...
 
bt_l2cap_mgr_tbt_sys_get_l2cap_manager (void)
 Get the L2CAP manager. More...
 
bt_gap_mgr_t * bt_sys_get_gap_manager (void)
 Get the GAP manager. More...
 
const bt_byte * bt_sys_get_version (void)
 Get the version of the dotstack library. More...
 

Detailed Description

Functions in this module provide interface to DotStack functionality that is common to all protocols and profiles.

Typedef Documentation

typedef void(* bt_sys_callback_fp) (bt_bool success, void *param)

System start callback.

This callback function is called when system start initiated by bt_sys_start() has completed.

Parameters
successSuccess of the operation: BT_TRUE if successfull, BT_FALSE otherwise.
paramCallback parameter that was specified when bt_sys_start() was called.

Function Documentation

bt_gap_mgr_t* bt_sys_get_gap_manager ( void  )

Get the GAP manager.

This function returns the GAP manager. The GAP manager is created as part of the start up sequence.

Returns
The GAP manager.
bt_l2cap_mgr_t* bt_sys_get_l2cap_manager ( void  )

Get the L2CAP manager.

This function returns the L2CAP manager. The L2CAP manager is created as part of the start up sequence.

Returns
The L2CAP manager.
const bt_byte* bt_sys_get_version ( void  )

Get the version of the dotstack library.

Returns
The version of the dotstack library.
void bt_sys_init ( void  )

Initialize the Bluetooth system.

This function initializes all internal variables of HCI, L2CAP and SDP modules. It must be called by the application before it can access any functionality provided by the library. In addition to this initialization function the application must call initialization functions of all other profile modules the application is intended to use. E.g., if the application is using the SPP module the bt_spp_init() must be called right after calling bt_sys_init().

This function essentially calls bt_sys_init_ex(HCI_LINK_POLICY_ENABLE_ALL) so all link policy setting are enabled.

void bt_sys_init_ex ( bt_byte  default_link_policy)

Initialize the Bluetooth system.

This function initializes all internal variables of HCI, L2CAP and SDP modules. It must be called by the application before it can access any functionality provided by the library. In addition to this initialization function the application must call initialization functions of all other profile modules the application is intended to use. E.g., if the application is using the SPP module the bt_spp_init() must be called right after calling bt_sys_init().

Also, the caller must provide an SDP database.

Parameters
default_link_policydefault link policy settings. This is a bitmask that defines the initial value of the link policy settings for all new BR/EDR connections. This value can be a combination of the following values:
  • HCI_LINK_POLICY_ENABLE_ROLE_SWITCH
  • HCI_LINK_POLICY_ENABLE_HOLD_MODE
  • HCI_LINK_POLICY_ENABLE_SNIFF_MODE
  • HCI_LINK_POLICY_ENABLE_PARK_STATE
To enable all settings pass HCI_LINK_POLICY_ENABLE_ALL.
void bt_sys_start ( bt_bool  discoverable,
bt_bool  connectable,
const bt_byte *  sdp_db,
bt_uint  sdp_db_len,
bt_sys_callback_fp  callback,
void *  callback_param 
)

Start the Bluetooth system.

After all modules used by the application have been initialized this function should be called to start the Bluetooth system operation. During the start up sequence it will reset and initialize the HCI controller and then create the L2CAP manager. The application will be notified when the start up sequence completes by calling the provided callback function.

Also, the caller must provide an SDP database.

Parameters
discoverabledefines whether the device is discoverable after reset.
connectabledefines whether the device is connectable after reset.
sdp_dbSDP database data.
sdp_db_lenLength of SDP database data.
callbackA callback function that will be called when the start up sequence is complete.
callback_paramAn arbitrary pointer that will be passed to the callback function.