Microchip® Advanced Software Framework

altbeacon.c File Reference

AltBeacon Application.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include "platform.h"
#include "at_ble_api.h"
#include "console_serial.h"
#include "conf_extint.h"
#include "altbeacon.h"
#include "ble_utils.h"

Functions

static void altbeacon_init (void)
 Initialize the alt beacon advertisement data and start advertisement. More...
 
static void ble_init (void)
 Initialize the BLE. More...
 
static void ble_set_address (at_ble_addr_t *addr)
 Set BLE Address, If address is NULL then it will use BD public address. More...
 
int main (void)
 

Variables

uint32_t event_params_memory [1024] = {0}
 
uint32_t event_pool_memory [256] = {0}
 
at_ble_init_config_t pf_cfg
 
uint32_t rx_fifo_memory [256] = {0}
 

static void ble_init ( void  )
static

Initialize the BLE.

References platform_api_list_tag::at_ble_create_signal, platform_api_list_tag::at_ble_create_timer, platform_api_list_tag::at_ble_delete_signal, platform_api_list_tag::at_ble_delete_timer, platform_api_list_tag::at_ble_gpio_set, at_ble_init(), platform_api_list_tag::at_ble_reconfigure_usart, platform_api_list_tag::at_ble_recv_async, platform_api_list_tag::at_ble_reset_signal, platform_api_list_tag::at_ble_send_sync, platform_api_list_tag::at_ble_sleep, platform_api_list_tag::at_ble_start_timer, platform_api_list_tag::at_ble_stop_timer, AT_BLE_SUCCESS, platform_api_list_tag::at_ble_trigger_signal, AT_BLE_UART, platform_api_list_tag::at_ble_wait_for_signal, AT_BTLC1000_MR, AT_BTLC1000_ZR, BTLC1000_EXT_PIN9, at_ble_init_config_t::btlc1000_module_version, at_ble_bus_info_t::btlc1000_uart_pinout_switch, at_ble_bus_info_t::bus_baudrate, at_ble_init_config_t::bus_info, at_ble_bus_info_t::bus_type, DBG_LOG, at_ble_init_config_t::event_mem_pool, at_ble_init_config_t::event_params_mem_pool, event_params_memory, event_pool_memory, at_ble_bus_info_t::host_external_wakeup_gpio, at_ble_init_config_t::memPool, at_ble_mempool_t::memSize, at_ble_mempool_t::memStartAdd, NULL, at_ble_init_config_t::platform_api_list, platform_configure_hw_fc_uart(), platform_configure_primary_uart(), platform_create_signal(), platform_create_timer(), platform_delete_signal(), platform_delete_timer(), platform_gpio_set(), platform_init(), platform_recv_async(), platform_reset_signal(), platform_send_sync(), platform_sleep(), platform_start_timer(), platform_stop_timer(), platform_trigger_signal(), platform_wait_for_signal(), at_ble_init_config_t::rx_fifo_mem_pool, and rx_fifo_memory.

Referenced by main().

static void ble_set_address ( at_ble_addr_t addr)
static

Set BLE Address, If address is NULL then it will use BD public address.

References addr, at_ble_addr_t::addr, at_ble_addr_get(), at_ble_addr_set(), AT_BLE_ADDRESS_PUBLIC, AT_BLE_SUCCESS, DBG_LOG, NULL, and at_ble_addr_t::type.

Referenced by main().

uint32_t event_params_memory[1024] = {0}

Referenced by ble_device_init(), and ble_init().

uint32_t event_pool_memory[256] = {0}

Referenced by ble_device_init(), and ble_init().

Initial value:
= {
.platform_api_list.at_ble_create_timer = platform_create_timer,
.platform_api_list.at_ble_delete_timer = platform_delete_timer,
.platform_api_list.at_ble_start_timer = platform_start_timer,
.platform_api_list.at_ble_stop_timer = platform_stop_timer,
.platform_api_list.at_ble_sleep = platform_sleep,
.platform_api_list.at_ble_gpio_set = platform_gpio_set,
.platform_api_list.at_ble_send_sync = platform_send_sync,
.platform_api_list.at_ble_recv_async = platform_recv_async,
.platform_api_list.at_ble_reconfigure_usart = platform_configure_hw_fc_uart,
.platform_api_list.at_ble_wait_for_signal = platform_wait_for_signal,
.platform_api_list.at_ble_create_signal = platform_create_signal,
.platform_api_list.at_ble_delete_signal = platform_delete_signal,
.platform_api_list.at_ble_trigger_signal = platform_trigger_signal,
.platform_api_list.at_ble_reset_signal = platform_reset_signal
}
void platform_wait_for_signal(uint32_t count, void **signal_handler_list)
Definition: ble_sdk/src/platform.c:273
void platform_delete_signal(void *signal_handler)
Definition: ble_sdk/src/platform.c:325
void * platform_create_signal(void)
Definition: ble_sdk/src/platform.c:310
void platform_send_sync(uint8_t *data, uint32_t len)
Definition: ble_sdk/src/platform.c:89
void * platform_create_timer(void(*timer_cb)(void *))
Definition: ble_sdk/src/platform.c:234
void platform_sleep(uint32_t ms)
Definition: ble_sdk/src/platform.c:258
void platform_delete_timer(void *timer_handle)
Definition: ble_sdk/src/platform.c:239
void platform_recv_async(void(*recv_async_callback)(uint8_t))
Definition: ble_sdk/src/platform.c:151
void platform_gpio_set(at_ble_gpio_pin_t pin, at_ble_gpio_status_t status)
Definition: ble_sdk/src/platform.c:112
void platform_start_timer(void *timer_handle, uint32_t ms)
Definition: ble_sdk/src/platform.c:244
void platform_configure_hw_fc_uart(uint32_t baudrate)
Definition: ble_sdk/src/platform.c:177
void platform_stop_timer(void *timer_handle)
Definition: ble_sdk/src/platform.c:251
void platform_reset_signal(void *signal_handler)
Definition: ble_sdk/src/platform.c:345
void platform_trigger_signal(void *signal_handler)
Definition: ble_sdk/src/platform.c:335
uint32_t rx_fifo_memory[256] = {0}

Referenced by ble_device_init(), and ble_init().