Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
main.c File Reference
#include <stdint.h>
#include <string.h>
#include "boards.h"
#include "app_util_platform.h"
#include "app_print.h"
#include "debug.h"
#include "ptu.h"
#include "app_timer.h"
#include "softdevice_handler.h"
#include "advertiser_beacon.h"
#include "ptu_config.h"
#include "nrf_nvic.h"
#include "common_hal_buttons.h"

Go to the source code of this file.

Macros

#define CENTRAL_LINK_COUNT   7
 
#define PERIPHERAL_LINK_COUNT   1
 
#define DEAD_BEEF   0xDEADBEEF
 
#define NO_DEV_CONNECTED_LED_PATTERN   0x00
 
#define POWER_TRANSFER_LED_PATTERN   0x01
 
#define FAULT_LED_PATTERN   0x02
 
#define BEACON_UUID
 
#define BEACON_ADV_INTERVAL   400
 
#define BEACON_MAJOR   0x1234
 
#define BEACON_MINOR   0x5678
 
#define BEACON_RSSI   0xC3
 
#define APP_COMPANY_IDENTIFIER   0x0059
 

Functions

static void beacon_adv_init (void)
 Function for initializing Beacon advertiser.
 
static void m_sys_evt_dispatch (uint32_t sys_evt)
 Dispatch system event, triggered by softdevice. More...
 
static void m_ble_evt_dispatch (ble_evt_t *p_evt)
 Dispatch BLE event, triggered by softdevice. More...
 
static void m_ble_stack_init (void)
 Initialize the BLE sofdevice and IRQ handler.
 
int main ()
 Application.
 

Variables

static ble_beacon_init_t beacon_init
 

Macro Definition Documentation

#define CENTRAL_LINK_COUNT   7

Number of central links used by the application. When changing this number remember to adjust the RAM settings

Definition at line 34 of file main.c.

#define PERIPHERAL_LINK_COUNT   1

Number of peripheral links used by the application. When changing this number remember to adjust the RAM settings

Definition at line 35 of file main.c.

#define DEAD_BEEF   0xDEADBEEF

Error code to signify a SoftDevice assert.

Definition at line 38 of file main.c.

#define NO_DEV_CONNECTED_LED_PATTERN   0x00

Status LEDs when no devices connected

Definition at line 44 of file main.c.

#define POWER_TRANSFER_LED_PATTERN   0x01

Status LEDs during power transfer state

Definition at line 45 of file main.c.

#define FAULT_LED_PATTERN   0x02

Status LEDs when in any fault state

Definition at line 46 of file main.c.

#define BEACON_UUID
Value:
0xff, 0xfe, 0x2d, 0x12, 0x1e, 0x4b, 0x0f, 0xa4,\
0x99, 0x4e, 0xce, 0xb5, 0x31, 0xf4, 0x05, 0x45

The Beacon's UUID

Definition at line 49 of file main.c.

#define BEACON_ADV_INTERVAL   400

The Beacon's advertising interval, in milliseconds

Definition at line 51 of file main.c.

#define BEACON_MAJOR   0x1234

The Beacon's Major

Definition at line 52 of file main.c.

#define BEACON_MINOR   0x5678

The Beacon's Minor

Definition at line 53 of file main.c.

#define BEACON_RSSI   0xC3

The Beacon's measured RSSI at 1 meter distance in dBm.

Definition at line 54 of file main.c.

#define APP_COMPANY_IDENTIFIER   0x0059

Company identifier for Nordic Semiconductor ASA. as per www.bluetooth.org.

Definition at line 56 of file main.c.

Function Documentation

static void m_sys_evt_dispatch ( uint32_t  sys_evt)
static

Dispatch system event, triggered by softdevice.

Parameters
sys_evtThe event to handle

Definition at line 83 of file main.c.

84 {
85 
86 }
static void m_ble_evt_dispatch ( ble_evt_t *  p_evt)
static

Dispatch BLE event, triggered by softdevice.

Parameters
[in]p_evtThe event to handle

Definition at line 91 of file main.c.

92 {
93  ptu_on_ble_evt(p_evt);
94 }
void ptu_on_ble_evt(ble_evt_t *p_ble_evt)
Dispatches a BLE stack event to PTU.
Definition: ptu.c:319

Variable Documentation

ble_beacon_init_t beacon_init
static

Beacon initializer parameters.

Definition at line 58 of file main.c.