ref_app_smart_presence.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "acc_definitions_a121.h"
#include "acc_definitions_common.h"
#include "acc_detector_presence.h"
#include "acc_hal_definitions_a121.h"
#include "acc_hal_integration_a121.h"
#include "acc_integration.h"
#include "acc_rss_a121.h"
#include "acc_sensor.h"
#include "acc_version.h"

Go to the source code of this file.

Data Structures

struct  acc_smart_presence_zone_result_t
 Smart presence reference application results container for each zone. More...
 
struct  acc_ref_app_smart_presence_wakeup_config_t
 
struct  acc_ref_app_smart_presence_zone_config_t
 
struct  acc_ref_app_smart_presence_config_t
 
struct  acc_smart_presence_result_t
 Smart presence reference application results container. More...
 
struct  presence_detector_context_t
 
struct  app_context_t
 

Macros

#define SENSOR_ID   (1U)
 
#define SENSOR_TIMEOUT_MS   (1000U)
 
#define DEFAULT_PRESET_CONFIG   SMART_PRESENCE_PRESET_CONFIG_MEDIUM_RANGE
 

Enumerations

enum  smart_presence_preset_config_t {
  SMART_PRESENCE_PRESET_CONFIG_NONE = 0, SMART_PRESENCE_PRESET_CONFIG_SHORT_RANGE, SMART_PRESENCE_PRESET_CONFIG_MEDIUM_RANGE, SMART_PRESENCE_PRESET_CONFIG_LONG_RANGE,
  SMART_PRESENCE_PRESET_CONFIG_CEILING, SMART_PRESENCE_PRESET_CONFIG_LOW_POWER_WAKEUP
}
 
enum  smart_presence_mode_t { SMART_PRESENCE_MODE_WAKEUP = 0, SMART_PRESENCE_MODE_NOMINAL }
 

Functions

static bool swap_config (app_context_t *context, smart_presence_mode_t new_mode)
 
static uint32_t get_max_buffer_size (app_context_t *context)
 
static uint16_t get_max_num_points (app_context_t *context)
 
static uint32_t get_max_num_zones (app_context_t *context)
 
static bool initialize_application_resources (app_context_t *context)
 
static void cleanup (app_context_t *context)
 
static bool initialize_sensor (app_context_t *context)
 
static bool sensor_prepare (app_context_t *context)
 
static bool sensor_calibration (app_context_t *context)
 
static bool detector_get_next (app_context_t *context, acc_detector_presence_result_t *detector_result)
 
static bool enter_hibernate (acc_sensor_t *sensor)
 
static bool exit_hibernate (acc_sensor_t *sensor)
 
static void set_config (acc_ref_app_smart_presence_config_t *app_config, smart_presence_preset_config_t preset)
 
static int32_t process_inter_intra (app_context_t *context, acc_detector_presence_result_t *presence_result, acc_smart_presence_result_t *result, bool inter)
 
static bool process_detector_result (app_context_t *context, acc_detector_presence_result_t *presence_result, acc_smart_presence_result_t *result, bool *swap_needed, smart_presence_mode_t *new_mode)
 
static bool determine_config_swap (app_context_t *context, acc_smart_presence_result_t *result, smart_presence_mode_t *new_mode)
 
static void print_result (app_context_t *context, acc_smart_presence_result_t *result)
 
int acconeer_main (int argc, char *argv[])
 Assembly test example. More...
 
static bool initialize_wakeup_resources (app_context_t *context)
 

Macro Definition Documentation

◆ DEFAULT_PRESET_CONFIG

#define DEFAULT_PRESET_CONFIG   SMART_PRESENCE_PRESET_CONFIG_MEDIUM_RANGE

Definition at line 45 of file ref_app_smart_presence.c.

◆ SENSOR_ID

#define SENSOR_ID   (1U)

Definition at line 42 of file ref_app_smart_presence.c.

◆ SENSOR_TIMEOUT_MS

#define SENSOR_TIMEOUT_MS   (1000U)

Definition at line 43 of file ref_app_smart_presence.c.

Enumeration Type Documentation

◆ smart_presence_mode_t

Enumerator
SMART_PRESENCE_MODE_WAKEUP 
SMART_PRESENCE_MODE_NOMINAL 

Definition at line 35 of file ref_app_smart_presence.c.

◆ smart_presence_preset_config_t

Enumerator
SMART_PRESENCE_PRESET_CONFIG_NONE 
SMART_PRESENCE_PRESET_CONFIG_SHORT_RANGE 
SMART_PRESENCE_PRESET_CONFIG_MEDIUM_RANGE 
SMART_PRESENCE_PRESET_CONFIG_LONG_RANGE 
SMART_PRESENCE_PRESET_CONFIG_CEILING 
SMART_PRESENCE_PRESET_CONFIG_LOW_POWER_WAKEUP 

Definition at line 25 of file ref_app_smart_presence.c.

Function Documentation

◆ acconeer_main()

int acconeer_main ( int  argc,
char *  argv[] 
)

Assembly test example.

Surface velocity example application.

Tank level reference application.

Smart presence reference application.

Breathing example application.

Service subsweeps example.

Service multple configurations example.

Low power service example.

Service example.

Processing subtract adaptive background example.

Processing static presence example.

Processing peak interpolation example.

Processing noncoherent mean example.

Processing coherent mean example.

Processing amplitude example.

Detector presence example with multiple configurations.

Low power detector presence example.

Detector presence example.

Distance detector low power example.

Detector distance example.

Control helper example.

Returns
Returns EXIT_SUCCESS if successful, otherwise EXIT_FAILURE

Test if measure on wake up is enable Do a measurement if the the detector is ready (configured and calibrated)

Test if measure on wake up is enable Do a measurement if the the detector is ready (configured and calibrated)

Detector filters and states are reset on prepare (reconfiguration) to avoid risk of false detections when switching back to a zone.

Detector filters and states are reset on prepare (reconfiguration) to avoid risk of false detections when switching back to a zone.

Definition at line 233 of file ref_app_smart_presence.c.

◆ cleanup()

static void cleanup ( app_context_t context)
static

Definition at line 659 of file ref_app_smart_presence.c.

◆ detector_get_next()

static bool detector_get_next ( app_context_t context,
acc_detector_presence_result_t detector_result 
)
static

Definition at line 789 of file ref_app_smart_presence.c.

◆ determine_config_swap()

static bool determine_config_swap ( app_context_t context,
acc_smart_presence_result_t result,
smart_presence_mode_t new_mode 
)
static

Definition at line 1361 of file ref_app_smart_presence.c.

◆ enter_hibernate()

static bool enter_hibernate ( acc_sensor_t sensor)
static

Definition at line 832 of file ref_app_smart_presence.c.

◆ exit_hibernate()

static bool exit_hibernate ( acc_sensor_t sensor)
static

Definition at line 848 of file ref_app_smart_presence.c.

◆ get_max_buffer_size()

static uint32_t get_max_buffer_size ( app_context_t context)
static

Definition at line 481 of file ref_app_smart_presence.c.

◆ get_max_num_points()

static uint16_t get_max_num_points ( app_context_t context)
static

Definition at line 497 of file ref_app_smart_presence.c.

◆ get_max_num_zones()

static uint32_t get_max_num_zones ( app_context_t context)
static

Definition at line 513 of file ref_app_smart_presence.c.

◆ initialize_application_resources()

static bool initialize_application_resources ( app_context_t context)
static

Definition at line 557 of file ref_app_smart_presence.c.

◆ initialize_sensor()

static bool initialize_sensor ( app_context_t context)
static

Definition at line 716 of file ref_app_smart_presence.c.

◆ initialize_wakeup_resources()

static bool initialize_wakeup_resources ( app_context_t context)
static

Definition at line 529 of file ref_app_smart_presence.c.

◆ print_result()

static void print_result ( app_context_t context,
acc_smart_presence_result_t result 
)
static

Definition at line 1420 of file ref_app_smart_presence.c.

◆ process_detector_result()

static bool process_detector_result ( app_context_t context,
acc_detector_presence_result_t presence_result,
acc_smart_presence_result_t result,
bool *  swap_needed,
smart_presence_mode_t new_mode 
)
static

Definition at line 1294 of file ref_app_smart_presence.c.

◆ process_inter_intra()

static int32_t process_inter_intra ( app_context_t context,
acc_detector_presence_result_t presence_result,
acc_smart_presence_result_t result,
bool  inter 
)
static

Definition at line 1173 of file ref_app_smart_presence.c.

◆ sensor_calibration()

static bool sensor_calibration ( app_context_t context)
static

Definition at line 748 of file ref_app_smart_presence.c.

◆ sensor_prepare()

static bool sensor_prepare ( app_context_t context)
static

Definition at line 729 of file ref_app_smart_presence.c.

◆ set_config()

static void set_config ( acc_ref_app_smart_presence_config_t app_config,
smart_presence_preset_config_t  preset 
)
static

Definition at line 864 of file ref_app_smart_presence.c.

◆ swap_config()

static bool swap_config ( app_context_t context,
smart_presence_mode_t  new_mode 
)
static

Definition at line 420 of file ref_app_smart_presence.c.