ble-mac.h File Reference

Public API and definitions of Nordic Softdevice BLE. More...

Detailed Description

Public API and definitions of Nordic Softdevice BLE.

Definition in file ble-mac.h.

Go to the source code of this file.

Data Structures

struct  ble_mac_inbuf_t
 Structure handling a received BLE mac packet. More...
 
#define BLE_IFACE_ADDED   (10000)
 
#define BLE_SIXLOWPAN_MTU   (1280U)
 
#define BLE_L2_ADDR_LEN   (6U)
 
#define IPV6_IID_FLIP_VALUE   (0x02)
 
enum  ble_mac_event_enum_t { BLE_EVENT_RX_DONE = 20000 }
 
typedef void(* ble_mac_callback_t) (ble_mac_event_enum_t event, void *arg)
 Mac event callback function definition.
 
volatile int ble_mac_busy_tx
 Flag is set to 1 when the driver is busy transmitting a packet. More...
 
volatile int ble_mac_busy_rx
 Flag is set to 1 when there is a received packet pending. More...
 
static void ble_eui48 (uint8_t *eui48, const uint8_t *ble_addr, int _public)
 Get BLE EUI64 from EUI48. More...
 
void ble_mac_init (ble_mac_callback_t callback)
 Initialize the BLE mac. More...
 
int ble_mac_send (uint8_t dest[BLE_L2_ADDR_LEN], void *data, size_t len)
 Send a BLE message. More...
 

Function Documentation

◆ ble_eui48()

static void ble_eui48 ( uint8_t *  eui48,
const uint8_t *  ble_addr,
int  _public 
)
inlinestatic

Get BLE EUI64 from EUI48.

Parameters
[out]eui48The output EUI48 (big-endian, 6 bytes long)
[in]ble_addrThe input BLE address (little-endian, 6 bytes long)
[in]_publicTrue if public interface, false otherwise

Definition at line 69 of file ble-mac.h.

◆ ble_mac_init()

void ble_mac_init ( ble_mac_callback_t  callback)

Initialize the BLE mac.

Parameters
[in]callbackThe callback function triggered on mac event

◆ ble_mac_send()

int ble_mac_send ( uint8_t  dest[BLE_L2_ADDR_LEN],
void *  data,
size_t  len 
)

Send a BLE message.

Parameters
[in]destThe destination address
[in]dataThe data to send
[in]lenThe length of the data to send
Returns
0 if send is successful
<0 if send failed

Variable Documentation

◆ ble_mac_busy_rx

volatile int ble_mac_busy_rx

Flag is set to 1 when there is a received packet pending.

◆ ble_mac_busy_tx

volatile int ble_mac_busy_tx

Flag is set to 1 when the driver is busy transmitting a packet.