Contiki-NG
Data Fields
ble_hal_driver Struct Reference

The structure of a ble radio controller driver in Contiki. More...

#include <os/dev/ble-hal.h>

Data Fields

ble_result_t(* reset )(void)
 Resets the BLE controller.
 
ble_result_t(* read_bd_addr )(uint8_t *addr)
 Reads the static BLE device address. More...
 
ble_result_t(* read_buffer_size )(unsigned int *buf_len, unsigned int *num_buf)
 Reads the size of the data buffers. More...
 
ble_result_t(* set_adv_param )(unsigned int adv_interval, ble_adv_type_t type, ble_addr_type_t own_addr_type, unsigned short adv_channel_map)
 Sets the parameter for advertising. More...
 
ble_result_t(* read_adv_channel_tx_power )(short *power)
 Reads the used power on the advertisement channels. More...
 
ble_result_t(* set_adv_data )(unsigned short data_len, char *data)
 Sets the advertising data. More...
 
ble_result_t(* set_scan_resp_data )(unsigned short data_len, char *data)
 Sets the scan response data. More...
 
ble_result_t(* set_adv_enable )(unsigned short enable)
 Enables/disables advertising. More...
 
ble_result_t(* set_scan_param )(ble_scan_type_t type, unsigned int scan_interval, unsigned int scan_window, ble_addr_type_t own_addr_type)
 Sets the parameter for scanning. More...
 
ble_result_t(* set_scan_enable )(unsigned short enable, unsigned short filter_duplicates)
 Enables/disables scanning. More...
 
ble_result_t(* create_connection )(unsigned int scan_interval, unsigned int scan_window, ble_addr_type_t peer_addr_type, uint8_t *peer_addr, ble_addr_type_t own_addr_type, unsigned int conn_interval, unsigned int conn_latency, unsigned int supervision_timeout)
 Initiates the creation of a BLE connection. More...
 
ble_result_t(* create_connection_cancel )(void)
 Cancels the initiation of a BLE connection.
 
ble_result_t(* connection_update )(unsigned int connection_handle, unsigned int conn_interval, unsigned int conn_latency, unsigned int supervision_timeout)
 Updates the connection parameters. More...
 
ble_result_t(* disconnect )(unsigned int connection_handle, unsigned short reason)
 Disconnects the connection. More...
 

Detailed Description

The structure of a ble radio controller driver in Contiki.

Definition at line 247 of file ble-hal.h.

Field Documentation

◆ connection_update

ble_result_t(* ble_hal_driver::connection_update) (unsigned int connection_handle, unsigned int conn_interval, unsigned int conn_latency, unsigned int supervision_timeout)

Updates the connection parameters.

Parameters
conn_intervalconnection interval (interval = conn_interval * 1.25 ms)
conn_latencyslave latency
supervision_timeout(timeout = supervision_timeout * 10 ms)

Definition at line 382 of file ble-hal.h.

◆ create_connection

ble_result_t(* ble_hal_driver::create_connection) (unsigned int scan_interval, unsigned int scan_window, ble_addr_type_t peer_addr_type, uint8_t *peer_addr, ble_addr_type_t own_addr_type, unsigned int conn_interval, unsigned int conn_latency, unsigned int supervision_timeout)

Initiates the creation of a BLE connection.

Parameters
scan_intervalscan interval (interval = scan_interval * 0.625 ms)
scan_windowscan window (window = scan_window * 0.625 ms)
peer_addr_typeindicator if peer address is public/random
peer_addrble address of the device to connect to
own_addr_typeindicator if own address is public/random
conn_intervalconnection interval (interval = conn_interval * 1.25 ms)
conn_latencyslave latency
supervision_timeout(timeout = supervision_timeout * 10 ms)

Definition at line 359 of file ble-hal.h.

◆ disconnect

ble_result_t(* ble_hal_driver::disconnect) (unsigned int connection_handle, unsigned short reason)

Disconnects the connection.

Parameters
connection_handle
reasonsee error codes of Bluetooth specification

Definition at line 393 of file ble-hal.h.

◆ read_adv_channel_tx_power

ble_result_t(* ble_hal_driver::read_adv_channel_tx_power) (short *power)

Reads the used power on the advertisement channels.

Parameters
powerthe used power in dBm

Definition at line 293 of file ble-hal.h.

◆ read_bd_addr

ble_result_t(* ble_hal_driver::read_bd_addr) (uint8_t *addr)

Reads the static BLE device address.

Parameters
addrthe static device address

Definition at line 261 of file ble-hal.h.

◆ read_buffer_size

ble_result_t(* ble_hal_driver::read_buffer_size) (unsigned int *buf_len, unsigned int *num_buf)

Reads the size of the data buffers.

Parameters
buf_lenthe length of a single data buffer
num_bufthe number of data buffers

Definition at line 269 of file ble-hal.h.

◆ set_adv_data

ble_result_t(* ble_hal_driver::set_adv_data) (unsigned short data_len, char *data)

Sets the advertising data.

Parameters
data_lenthe length of the advertising data
datathe data to advertise

Definition at line 301 of file ble-hal.h.

◆ set_adv_enable

ble_result_t(* ble_hal_driver::set_adv_enable) (unsigned short enable)

Enables/disables advertising.

Parameters
enableif 1 then enable advertising, otherwise disable

Definition at line 318 of file ble-hal.h.

◆ set_adv_param

ble_result_t(* ble_hal_driver::set_adv_param) (unsigned int adv_interval, ble_adv_type_t type, ble_addr_type_t own_addr_type, unsigned short adv_channel_map)

Sets the parameter for advertising.

Parameters
adv_intervaladvertising interval (interval = adv_interval * 0.625 ms)
typetype of advertising
own_addr_typeindicator if own address is public/random
adv_channel_mapmap of advertising channels to use

Definition at line 283 of file ble-hal.h.

◆ set_scan_enable

ble_result_t(* ble_hal_driver::set_scan_enable) (unsigned short enable, unsigned short filter_duplicates)

Enables/disables scanning.

Parameters
enable1: enable scanning, otherwise disable
filter_duplicates1: filter duplicates, otherwise no filtering

Definition at line 341 of file ble-hal.h.

◆ set_scan_param

ble_result_t(* ble_hal_driver::set_scan_param) (ble_scan_type_t type, unsigned int scan_interval, unsigned int scan_window, ble_addr_type_t own_addr_type)

Sets the parameter for scanning.

Parameters
typescan mode
scan_intervalscan interval (interval = scan_interval * 0.625 ms)
scan_windowscan window (window = scan_window * 0.625 ms)
own_addr_typeindicator if own address is public/random

Definition at line 330 of file ble-hal.h.

◆ set_scan_resp_data

ble_result_t(* ble_hal_driver::set_scan_resp_data) (unsigned short data_len, char *data)

Sets the scan response data.

Parameters
data_lenthe length of the scan response data
datathe data of a scan response

Definition at line 310 of file ble-hal.h.