Nordic Semiconductor nRF5 AirFuel SDK
version 2.2.0
|
#include <string.h>
#include "nrf_assert.h"
#include "app_timer.h"
#include "ptu.h"
#include "ptu_config.h"
#include "ptu_distant_list_handler.h"
Go to the source code of this file.
Functions | |
APP_TIMER_DEF (m_ignore_latency_timer_id) | |
static bool | m_address_equals (ble_gap_addr_t const *p_a1, ble_gap_addr_t const *p_a2) |
Check if two ble_gap_addr_t addresses are equal. More... | |
static uint8_t | m_next_index (uint8_t current_index) |
Get next index in distant list array. More... | |
static void | m_ignore_latency_timer_id_handler (void *p_context) |
Hander for the ignore latency timer id. More... | |
static bool | m_address_in_distant_list (ble_gap_addr_t const *p_addr) |
Check if given address is in the distant list. More... | |
static void | m_remove_device (ble_gap_addr_t const *p_addr) |
Removes given address from distant list. More... | |
void | ptu_dlh_notify_beacon_active (void) |
Notify distant list handler that the beacon is now active. More... | |
void | ptu_dlh_notify_beacon_disabled (void) |
Notify distant list handler that the beacon is now disabled. More... | |
void | ptu_dlh_on_wpt_adv_report (ble_gap_addr_t const *p_addr, uint8_t adv_flags) |
Distance list handler WPT Advertisement report handler. More... | |
bool | ptu_dlh_device_is_in_distant_list (ble_gap_addr_t const *p_addr) |
Check if device with provided address is in the distant list. More... | |
uint32_t | ptu_dlh_init (ptu_dlh_init_t const *p_init) |
Check if device with provided address is in the distant list. More... | |
Variables | |
static uint8_t | m_distant_list_index |
static bool | m_ignoring_devices |
static ble_gap_addr_t | m_distant_list [PTU_DISTANT_LIST_LEN] |
static uint32_t | m_ignore_latency_ms |
APP_TIMER_DEF | ( | m_ignore_latency_timer_id | ) |
Timer ID for ensuring latency from notification of beacon being disabled to starting to add devices .
|
static |
Check if two ble_gap_addr_t addresses are equal.
Will assert if either of the address pointers are NULL
p_a1 | First address to check |
p_a2 | Address to check against |
Definition at line 38 of file ptu_distant_list_handler.c.
|
static |
Get next index in distant list array.
Works as a circular buffer where values are overwritten when it is full.
current_index | The current index |
Definition at line 51 of file ptu_distant_list_handler.c.
|
static |
Hander for the ignore latency timer id.
Will set 'm_ignoring_devices' to false, I.E. stop adding devices to the distant list
p_context | The given context |
Definition at line 62 of file ptu_distant_list_handler.c.
|
static |
Check if given address is in the distant list.
p_addr | Address to check |
Definition at line 72 of file ptu_distant_list_handler.c.
|
static |
Removes given address from distant list.
Will assert if p_addr is NULL
p_addr | Address of device to remove |
Definition at line 91 of file ptu_distant_list_handler.c.
void ptu_dlh_notify_beacon_active | ( | void | ) |
Notify distant list handler that the beacon is now active.
When this function is called, the distant list handler will not add new devices discovered to the distant list.
Definition at line 104 of file ptu_distant_list_handler.c.
void ptu_dlh_notify_beacon_disabled | ( | void | ) |
Notify distant list handler that the beacon is now disabled.
When this function is called, the distant list handler will not add new devices discovered to the distant list.
Definition at line 112 of file ptu_distant_list_handler.c.
void ptu_dlh_on_wpt_adv_report | ( | ble_gap_addr_t const * | p_addr, |
uint8_t | adv_flags | ||
) |
Distance list handler WPT Advertisement report handler.
Will check address of advertisement and depending on the current state of the beacon, it will either add it to the distant list, or not.
p_addr | Address of device advertising |
adv_flags | WPT Advertisement Flags found in advertisement |
Definition at line 117 of file ptu_distant_list_handler.c.
bool ptu_dlh_device_is_in_distant_list | ( | ble_gap_addr_t const * | p_addr | ) |
Check if device with provided address is in the distant list.
Will check address of advertisement and depending on the current state of the beacon, it will either add it to the distant list, or not.
p_addr | Address to check |
Definition at line 137 of file ptu_distant_list_handler.c.
uint32_t ptu_dlh_init | ( | ptu_dlh_init_t const * | p_init | ) |
Check if device with provided address is in the distant list.
p_init | Initializing parameters |
Definition at line 144 of file ptu_distant_list_handler.c.
|
static |
Current index in distant list array.
Definition at line 25 of file ptu_distant_list_handler.c.
|
static |
Is devices currently being added to the distant list? I.E. is the Long Beacon NOT active?
Definition at line 26 of file ptu_distant_list_handler.c.
|
static |
Distant list, list of GAP addresses to be ignored.
Definition at line 27 of file ptu_distant_list_handler.c.
|
static |
How long after getting notified of beacon disabled should the distant list handler start adding devices to the distant list?
Definition at line 28 of file ptu_distant_list_handler.c.