47#define BLE_ADDR_SIZE 6
50#define BLE_ADV_DATA_LEN 31
51#define BLE_SCAN_RESP_DATA_LEN 31
52#define BLE_ADV_CHANNEL_1 37
53#define BLE_ADV_CHANNEL_1_MASK 0b001
54#define BLE_ADV_CHANNEL_2 38
55#define BLE_ADV_CHANNEL_2_MASK 0b010
56#define BLE_ADV_CHANNEL_3 39
57#define BLE_ADV_CHANNEL_3_MASK 0b100
58#define BLE_ADV_INTERVAL_MIN 20
59#define BLE_ADV_INTERVAL_MAX 0x4000
60#define BLE_SCAN_INTERVAL_MIN 0x0004
61#define BLE_SCAN_INTERVAL_MAX 0x4000
64#define BLE_DATA_CHANNEL_MIN 0
65#define BLE_DATA_CHANNEL_MAX 36
67#define BLE_DATA_PDU_LLID_DATA_FRAGMENT 0b01
68#define BLE_DATA_PDU_LLID_DATA_MESSAGE 0b10
69#define BLE_DATA_PDU_LLID_CONTROL 0b11
72#define BLE_LL_CONN_UPDATE_REQ 0x00
73#define BLE_LL_CHANNEL_MAP_REQ 0x01
74#define BLE_LL_TERMINATE_IND 0x02
75#define BLE_LL_ENC_REQ 0x03
76#define BLE_LL_ENC_RSP 0x04
77#define BLE_LL_START_ENC_REQ 0x05
78#define BLE_LL_START_ENC_RSP 0x06
79#define BLE_LL_UNKNOWN_RSP 0x07
80#define BLE_LL_FEATURE_REQ 0x08
81#define BLE_LL_FEATURE_RSP 0x09
82#define BLE_LL_PAUSE_ENC_REQ 0x0A
83#define BLE_LL_PAUSE_ENC_RSP 0x0B
84#define BLE_LL_VERSION_IND 0x0C
85#define BLE_LL_REJECT_IND 0x0D
86#define BLE_LL_SLAVE_FEATURE_REQ 0x0E
87#define BLE_LL_CONN_PARAM_REQ 0x0F
88#define BLE_LL_CONN_PARAM_RSP 0x10
89#define BLE_LL_REJECT_IND_EXT 0x11
90#define BLE_LL_PING_REQ 0x12
91#define BLE_LL_PING_RSP 0x13
93#define FRAME_BLE_RX_EVENT 0x00
94#define FRAME_BLE_TX_EVENT 0x10
95#define FRAME_BLE_CONNECTION_EVENT 0x20
96#define FRAME_BLE_CONNECTION_UPDATED 0x30
101 BLE_RESULT_NOT_SUPPORTED,
102 BLE_RESULT_INVALID_PARAM,
109 BLE_ADDR_TYPE_PUBLIC,
145 BLE_SCAN_FILTER_POLICY_ACCEPT,
147 BLE_SCAN_FILTER_POLICY_IGNORE
148} ble_scan_filter_policy_t;
152 struct ble_buf_list *next;
153 struct queuebuf *buf;
164 RADIO_CONST_BLE_BD_ADDR = 100,
167 RADIO_CONST_BLE_BUFFER_SIZE,
170 RADIO_CONST_BLE_BUFFER_AMOUNT,
176 RADIO_PARAM_BLE_ADV_INTERVAL,
179 RADIO_PARAM_BLE_ADV_TYPE,
182 RADIO_PARAM_BLE_ADV_OWN_ADDR_TYPE,
185 RADIO_PARAM_BLE_ADV_CHANNEL_MAP,
188 RADIO_PARAM_BLE_ADV_PAYLOAD,
191 RADIO_PARAM_BLE_ADV_SCAN_RESPONSE,
194 RADIO_PARAM_BLE_ADV_ENABLE,
200 RADIO_PARAM_BLE_SCAN_INTERVAL,
203 RADIO_PARAM_BLE_SCAN_WINDOW,
206 RADIO_PARAM_BLE_SCAN_TYPE,
209 RADIO_PARAM_BLE_SCAN_OWN_ADDR_TYPE,
212 RADIO_PARAM_BLE_SCAN_CHANNEL,
215 RADIO_PARAM_BLE_SCAN_ENABLE,
223 RADIO_PARAM_BLE_PEER_ADDR_TYPE,
226 RADIO_PARAM_BLE_PEER_ADDR,
229 RADIO_PARAM_BLE_CONN_INTERVAL,
232 RADIO_PARAM_BLE_CONN_LATENCY,
235 RADIO_PARAM_BLE_CONN_SUPERVISION_TIMEOUT,
238 RADIO_PARAM_BLE_INITIATOR_ENABLE,
240 RADIO_PARAM_BLE_CONN_UPDATE
270 unsigned int *num_buf);
285 ble_addr_type_t own_addr_type,
286 unsigned short adv_channel_map);
331 unsigned int scan_interval,
332 unsigned int scan_window,
333 ble_addr_type_t own_addr_type);
342 unsigned short filter_duplicates);
360 unsigned int scan_window,
361 ble_addr_type_t peer_addr_type,
363 ble_addr_type_t own_addr_type,
364 unsigned int conn_interval,
365 unsigned int conn_latency,
366 unsigned int supervision_timeout);
383 unsigned int conn_interval,
384 unsigned int conn_latency,
385 unsigned int supervision_timeout);
394 unsigned short reason);
396 ble_result_t (*send) (
void *buf,
unsigned short buf_len);
398 ble_result_t (*send_list) (
struct ble_buf_list *list);
400 ble_result_t (*read_connection_interval) (
unsigned int conn_handle,
401 unsigned int *conn_interval_ms);
The structure of a ble radio controller driver in Contiki.
ble_result_t(* set_adv_enable)(unsigned short enable)
Enables/disables advertising.
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.
ble_result_t(* read_adv_channel_tx_power)(short *power)
Reads the used power on the advertisement channels.
ble_result_t(* set_scan_enable)(unsigned short enable, unsigned short filter_duplicates)
Enables/disables scanning.
ble_result_t(* reset)(void)
Resets the BLE controller.
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.
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.
ble_result_t(* create_connection_cancel)(void)
Cancels the initiation of a BLE connection.
ble_result_t(* read_bd_addr)(uint8_t *addr)
Reads the static BLE device address.
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.
ble_result_t(* set_scan_resp_data)(unsigned short data_len, char *data)
Sets the scan response data.
ble_result_t(* disconnect)(unsigned int connection_handle, unsigned short reason)
Disconnects the connection.
ble_result_t(* set_adv_data)(unsigned short data_len, char *data)
Sets the advertising data.
ble_result_t(* read_buffer_size)(unsigned int *buf_len, unsigned int *num_buf)
Reads the size of the data buffers.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.