LoRa-BLE-Sensor
Loading...
Searching...
No Matches
Macros | Functions | Variables
sensor_app.c File Reference

A library to manage sensor applications. Working between power configurations, data configurations, and scheduling for sensor reading. As well as LoRaWAN initialization, scheduling, and data transmission. This library also handles the BLE services for the device, sensor, and LoRaWAN. More...

#include "sensor_app.h"
#include "sensor_ble.h"
#include "sensor_scheduling.h"
#include "sensor_data.h"
#include "sensor_nvs.h"
#include "sensor_lorawan.h"
#include "sensor_pmic.h"
#include "ble_sensor_service.h"
#include "ble_lorawan_service.h"
#include "ble_device_service.h"
#include "sensor_names.h"
#include <zephyr/logging/log.h>
#include <zephyr/kernel.h>
Include dependency graph for sensor_app.c:

Macros

#define BLE_STACKSIZE   1024
 
#define BLE_THREAD_PRIORITY   1
 

Functions

 LOG_MODULE_REGISTER (SENSOR_APP, LOG_LEVEL_INF)
 
 K_THREAD_STACK_DEFINE (ble_stack, BLE_STACKSIZE)
 
int sensor_app_init (sensor_app_config_t *config)
 Initialize the sensor app, handle anything that needs to be initialized for the app such as timers, nvs, etc.
 
int sensor_app_configuration_state (void)
 Execute the sensor app configuration state.
 
int sensor_app_running_state (void)
 Execute the sensor app running state.
 
int sensor_app_error_state (void)
 Execute the sensor app error state.
 
int sensor_app_ble_start (void)
 Start the BLE advertising and services.
 

Variables

struct k_thread blethread_id
 

Detailed Description

A library to manage sensor applications. Working between power configurations, data configurations, and scheduling for sensor reading. As well as LoRaWAN initialization, scheduling, and data transmission. This library also handles the BLE services for the device, sensor, and LoRaWAN.

Author
Tyler Garcia
Version
0.1
Date
2025-04-28

Function Documentation

◆ sensor_app_ble_start()

int sensor_app_ble_start ( void  )

Start the BLE advertising and services.

Returns
int 0 on success, -1 on failure

◆ sensor_app_configuration_state()

int sensor_app_configuration_state ( void  )

Execute the sensor app configuration state.

Returns
int 0 on success, -1 on failure

◆ sensor_app_error_state()

int sensor_app_error_state ( void  )

Execute the sensor app error state.

Returns
int 0 on success, -1 on failure

◆ sensor_app_init()

int sensor_app_init ( sensor_app_config_t config)

Initialize the sensor app, handle anything that needs to be initialized for the app such as timers, nvs, etc.

Returns
int 0 on success, -1 on failure

◆ sensor_app_running_state()

int sensor_app_running_state ( void  )

Execute the sensor app running state.

Returns
int 0 on success, -1 on failure