4#ifndef PSTOP_PSTOP_APPLICATION_H
5#define PSTOP_PSTOP_APPLICATION_H
10#include "pstop/error.h"
11#include "pstop/device_id.h"
18} pstop_status_message_t;
40void remote_detail_set(
remote_details_t *oper,
bool is_allowed, uint64_t heartbeat_ms,
bool is_stop_only);
64typedef void (* pstop_status_t)(pstop_status_message_t status);
74typedef void (* log_message_t)(uint64_t timestamp,
const device_id_t *client, uint8_t message, pstop_error_t error);
143void pstop_application_set_remote_cb(
pstop_application_t *app, get_remote_details_t remote_cb);
145void pstop_application_set_hardware_status_cb(
pstop_application_t *app, pstop_status_t status_cb);
150 uint16_t max_lost_messages, uint16_t max_missed_heartbeats, uint32_t stop_ok_delay_ms);
Identifier of a pstop device.
Definition device_id.h:12
Some configuration details.
Definition pstop_application.h:79
uint32_t delay_between_stop_ms
The minimum time (in milliseconds) between the stop and OK messages used for transitioning to OK afte...
Definition pstop_application.h:97
uint16_t max_lost_messages
The maximum number of messages that can be lost before the pstop library reports a client as lost and...
Definition pstop_application.h:85
uint16_t max_missed_heartbeats
The maximum number of heartbeat messages that can be lost before the library reports a client as lost...
Definition pstop_application.h:91
Callbacks and configuration supplied by the application.
Definition pstop_application.h:102
get_remote_details_t remote_details_cb
Callback to return details for a specified remote.
Definition pstop_application.h:120
pstop_application_config_t app_config
Limits for lost messages and heartbeats.
Definition pstop_application.h:133
device_id_t machine_device_id
The device ID for this machine.
Definition pstop_application.h:113
pstop_os_env_t env
An OS environment struct that contains a callback for getting the current time.
Definition pstop_application.h:108
pstop_status_t status_cb
Notifies the underlying hardware about the status of this PSTOP.
Definition pstop_application.h:125
log_message_t log_message_cb
Callback to log any errors in the system.
Definition pstop_application.h:130
This struct contains a callback function to return the current time in milliseconds.
Definition os.h:21
Per-remote settings returned by get_remote_details_t.
Definition pstop_application.h:21
bool allowed
Is this device_id allowed?
Definition pstop_application.h:26
uint64_t heartbeat_ms
The heartbeat time for this device_id in milliseconds.
Definition pstop_application.h:31
bool stop_only
Is this device_id a stop-only (can't transition to OK) operator?
Definition pstop_application.h:36