LoRa-BLE-Sensor
Loading...
Searching...
No Matches
Functions
sensor_scheduling.c File Reference

This is a library to schedule sensor readings and radio transmissions. More...

#include "sensor_scheduling.h"
#include "sensor_timer.h"
#include <zephyr/logging/log.h>
Include dependency graph for sensor_scheduling.c:

Functions

 LOG_MODULE_REGISTER (SENSOR_SCHEDULING, LOG_LEVEL_INF)
 
int sensor_scheduling_init (const struct device *timer)
 Initialize the sensor scheduling module.
 
int sensor_scheduling_add_schedule (sensor_scheduling_cfg_t *schedule)
 Add a schedule to the sensor scheduling module.
 
int sensor_scheduling_remove_schedule (sensor_scheduling_cfg_t *schedule)
 Remove a schedule from the sensor scheduling module.
 
int sensor_scheduling_reset_schedule (sensor_scheduling_cfg_t *schedule)
 Reset a schedule in the sensor scheduling module. This will set the alarm to trigger at the given frequency from the last event time. Triggering the next event based on the last event time keeps the schedule from drifting.
 
int sensor_scheduling_get_seconds (void)
 Get the current time in seconds since the scheduling module was initialized.
 

Detailed Description

This is a library to schedule sensor readings and radio transmissions.

Author
Tyler Garcia
Version
0.1
Date
2025-05-12

Function Documentation

◆ sensor_scheduling_add_schedule()

int sensor_scheduling_add_schedule ( sensor_scheduling_cfg_t schedule)

Add a schedule to the sensor scheduling module.

Parameters
scheduleThe schedule to add
Returns
int 0 on success, negative error code on failure

◆ sensor_scheduling_get_seconds()

int sensor_scheduling_get_seconds ( void  )

Get the current time in seconds since the scheduling module was initialized.

Returns
int The current time in seconds

◆ sensor_scheduling_init()

int sensor_scheduling_init ( const struct device *  timer)

Initialize the sensor scheduling module.

Parameters
timerThe timer device to use for scheduling
Returns
int 0 on success, negative error code on failure

◆ sensor_scheduling_remove_schedule()

int sensor_scheduling_remove_schedule ( sensor_scheduling_cfg_t schedule)

Remove a schedule from the sensor scheduling module.

Parameters
scheduleThe schedule to remove
Returns
int 0 on success, negative error code on failure

◆ sensor_scheduling_reset_schedule()

int sensor_scheduling_reset_schedule ( sensor_scheduling_cfg_t schedule)

Reset a schedule in the sensor scheduling module. This will set the alarm to trigger at the given frequency from the last event time. Triggering the next event based on the last event time keeps the schedule from drifting.

Parameters
scheduleThe schedule to reset
Returns
int 0 on success, negative error code on failure