Contiki-NG
Loading...
Searching...
No Matches

Files

file  rf-ble.c
 Implementation of the CC13xx/CC26xx RF BLE driver.
 
file  rf-ble.h
 Header file for the CC13xx/CC26xx BLE driver.
 

Functions

radio_value_t rf_ble_get_tx_power (void)
 Get TX power for BLE advertisements.
 
void rf_ble_set_tx_power (radio_value_t power)
 Set TX power for BLE advertisements.
 
void rf_ble_beacond_config (clock_time_t interval, const char *name)
 Set the device name to use with the BLE advertisement/beacon daemon.
 
uint8_t rf_ble_beacond_start (void)
 Start the BLE advertisement/beacon daemon.
 
uint8_t rf_ble_is_active (void)
 Check whether the BLE beacond is currently active.
 
void rf_ble_beacond_stop (void)
 Stop the BLE advertisement/beacon daemon.
 
void rf_ble_beacon_single (uint8_t channel, uint8_t *data, uint8_t len)
 Transmit a single BLE advertisement in one or more advertisement channels.
 

Detailed Description

Function Documentation

◆ rf_ble_beacon_single()

void rf_ble_beacon_single ( uint8_t channel,
uint8_t * data,
uint8_t len )

Transmit a single BLE advertisement in one or more advertisement channels.

Parameters
channelBitmask of advertisement channels to be used: use BLE_ADV_CHANNEL_37 for channel 37, BLE_ADV_CHANNEL_38 for channel 38, BLE_ADV_CHANNEL_39 for channel 39, or any 'or' combination of those
dataA pointer to the advertisement data buffer
lenThe length of the advertisement data. If more than BLE_ADV_MAX_SIZE, the first BLE_ADV_MAX_SIZE bytes will be used.

Transmits a given advertisement payload once in one or any arbitrary combination of advertisement channels.

Definition at line 308 of file rf-ble.c.

References oscillators_request_hf_xosc(), oscillators_switch_to_hf_rc(), oscillators_switch_to_hf_xosc(), rf_core_boot(), rf_core_is_accessible(), rf_core_power_down(), rf_core_primary_mode_abort(), rf_core_primary_mode_restore(), and rf_core_send_cmd().

◆ rf_ble_beacond_config()

void rf_ble_beacond_config ( clock_time_t interval,
const char * name )

Set the device name to use with the BLE advertisement/beacon daemon.

Parameters
intervalThe interval (ticks) between two consecutive beacon bursts
nameThe device name to advertise

If name is NULL it will be ignored. If interval==0 it will be ignored. Thus, this function can be used to configure a single parameter at a time if so desired.

Definition at line 219 of file rf-ble.c.

◆ rf_ble_beacond_start()

uint8_t rf_ble_beacond_start ( void )

Start the BLE advertisement/beacon daemon.

Returns
RF_CORE_CMD_OK: Success, RF_CORE_CMD_ERROR: Failure

Before calling this function, the name to advertise must first be set by calling rf_ble_beacond_config(). Otherwise, this function will return an error.

Definition at line 240 of file rf-ble.c.

References process_start().

◆ rf_ble_get_tx_power()

radio_value_t rf_ble_get_tx_power ( void )

Get TX power for BLE advertisements.

Returns
The TX power for BLE advertisements

Definition at line 193 of file rf-ble.c.

◆ rf_ble_is_active()

uint8_t rf_ble_is_active ( void )

Check whether the BLE beacond is currently active.

Return values
1The radio is in BLE mode
0The BLE daemon is not active, or disabled

Definition at line 262 of file rf-ble.c.

◆ rf_ble_set_tx_power()

void rf_ble_set_tx_power ( radio_value_t power)

Set TX power for BLE advertisements.

Parameters
powerThe 'at least' TX power in dBm, values avove 5 dBm will be ignored

Set TX power to 'at least' power dBm. This works with a lookup table. If the value of 'power' does not exist in the lookup table, TXPOWER will be set to the immediately higher available value

Definition at line 205 of file rf-ble.c.