Contiki-NG
|
Files | |
file | ble-core.c |
Basic BLE functions. | |
file | ble-core.h |
Basic BLE functions. | |
file | ble-mac.c |
A MAC protocol implementation that uses nRF52 IPSP implementation as a link layer. | |
file | ble-mac.h |
A MAC protocol implementation that uses nRF52 IPSP implementation as a link layer. | |
Macros | |
#define | APP_ADV_TIMEOUT 0 |
Time for which the device must be advertising in non-connectable mode (in seconds). More... | |
#define | APP_ADV_ADV_INTERVAL MSEC_TO_UNITS(333, UNIT_0_625_MS) |
The advertising interval. More... | |
#define | BLE_MAC_MAX_INTERFACE_NUM 1 |
Maximum number of interfaces, i.e., connection to master devices. | |
Functions | |
static void | ble_evt_dispatch (ble_evt_t *p_ble_evt) |
SoftDevice BLE event callback. More... | |
void | ble_stack_init (void) |
Initialize and enable the BLE stack. | |
void | ble_get_mac (uint8_t addr[8]) |
Return device EUI64 MAC address. More... | |
void | ble_advertising_init (const char *name) |
Initialize BLE advertising data. More... | |
void | ble_advertising_start (void) |
Start BLE advertising. | |
void | ble_gap_addr_print (const ble_gap_addr_t *addr) |
Print GAP address. More... | |
static void | on_ble_evt (ble_evt_t *p_ble_evt) |
Function for handling the Application's BLE Stack events. More... | |
static ble_mac_interface_t * | ble_mac_interface_lookup (ble_ipsp_handle_t *handle) |
Lookup interface by IPSP connection. More... | |
static ble_mac_interface_t * | ble_mac_interface_add (eui64_t *peer, ble_ipsp_handle_t *handle) |
Add IPSP connection to the interface table. More... | |
static void | ble_mac_interface_delete (ble_mac_interface_t *interface) |
Remove interface from the interface table. More... | |
static uint32_t | ble_mac_ipsp_evt_handler_irq (ble_ipsp_handle_t *p_handle, ble_ipsp_evt_t *p_evt) |
Callback registered with IPSP to receive asynchronous events from the module. More... | |
static ble_ipsp_handle_t * | find_handle (const linkaddr_t *addr) |
Lookup IPSP handle by peer address. More... | |
static int | send_to_peer (ble_ipsp_handle_t *handle) |
Send packet on a given IPSP handle. More... | |
Variables | |
static ble_gap_adv_params_t | m_adv_params |
Parameters to be passed to the stack when starting advertising. More... | |
process_event_t | ble_event_interface_added |
This event is broadcast when BLE connection is established. More... | |
process_event_t | ble_event_interface_deleted |
This event is broadcast when BLE connection is destroyed. More... | |
static volatile int | busy_tx |
Flag is set to 1 when the driver is busy transmitting a packet. More... | |
static volatile int | busy_rx |
Flag is set to 1 when there is a received packet pending. More... | |
const struct mac_driver | ble_ipsp_mac_driver |
BLE over IPSP MAC driver structure. | |
const struct mac_driver | ble_ipsp_mac_driver |
BLE over IPSP MAC driver structure. | |
process_event_t | ble_event_interface_added |
This event is broadcast when a new IPSP connection is established. More... | |
process_event_t | ble_event_interface_deleted |
This event is broadcast when a IPSP connection is deleted. More... | |
#define APP_ADV_ADV_INTERVAL MSEC_TO_UNITS(333, UNIT_0_625_MS) |
The advertising interval.
This value can vary between 100ms to 10.24s).
Definition at line 64 of file ble-core.c.
#define APP_ADV_TIMEOUT 0 |
Time for which the device must be advertising in non-connectable mode (in seconds).
0 disables timeout.
Definition at line 63 of file ble-core.c.
void ble_advertising_init | ( | const char * | name | ) |
Initialize BLE advertising data.
name | Human readable device name that will be advertised |
Definition at line 126 of file ble-core.c.
|
static |
SoftDevice BLE event callback.
[in] | p_ble_evt | Bluetooth stack event. |
Definition at line 222 of file ble-core.c.
References on_ble_evt().
void ble_gap_addr_print | ( | const ble_gap_addr_t * | addr | ) |
void ble_get_mac | ( | uint8_t | addr[8] | ) |
Return device EUI64 MAC address.
addr | pointer to a buffer to store the address |
Definition at line 110 of file ble-core.c.
Referenced by platform_init_stage_three().
|
static |
Add IPSP connection to the interface table.
This function binds IPSP connection with peer address.
peer | a pointer to eui64 address |
handle | a pointer to IPSP handle |
a | pointer to an interface structure on success |
NULL | if interface table is full |
|
static |
|
static |
|
static |
Callback registered with IPSP to receive asynchronous events from the module.
[in] | p_handle | Pointer to IPSP handle. |
[in] | p_evt | Pointer to specific event, generated by IPSP module. |
|
static |
|
static |
Function for handling the Application's BLE Stack events.
[in] | p_ble_evt | Bluetooth stack event. |
Definition at line 196 of file ble-core.c.
Referenced by ble_evt_dispatch().
|
static |
process_event_t ble_event_interface_added |
process_event_t ble_event_interface_added |
process_event_t ble_event_interface_deleted |
process_event_t ble_event_interface_deleted |
|
static |
|
static |
|
static |
Parameters to be passed to the stack when starting advertising.
Definition at line 66 of file ble-core.c.
Referenced by ble_advertising_start().