4#ifndef PSTOP_AUX_CHANNEL_H
5#define PSTOP_AUX_CHANNEL_H
17#include "pstop/machine.h"
18#include "pstop/pstop_msg.h"
19#include "pstop/pstop_remote_data.h"
24#define PSTOP_AUX_UP_VERSION 0x01u
26#define PSTOP_AUX_UP_ROLE_SHIFT 8u
28#define PSTOP_AUX_BYTE_MASK 0xFFu
50 if (msg->
version != PSTOP_VERSION) {
115 c->
is_stop_only = !pstop_aux_role_is_operator(pstop_aux_decode_role(req));
126 if ((err != PSTOP_OK) || (req->
message != PSTOP_MESSAGE_STOP)) {
pstop_aux_role_t
Remote role, declared by the remote on every frame; wire-stable values.
Definition pstop_aux_channel.h:32
@ PSTOP_AUX_ROLE_OPERATOR
May re-arm with a STOP -> OK gesture.
Definition pstop_aux_channel.h:38
@ PSTOP_AUX_ROLE_STOP_ONLY
May only STOP, never re-arm.
Definition pstop_aux_channel.h:36
@ PSTOP_AUX_ROLE_UNSPECIFIED
No role claim (unprovisioned or version mismatch); treated as non-operator.
Definition pstop_aux_channel.h:34
#define PSTOP_AUX_UP_ROLE_SHIFT
Bit position of the role in padding1.
Definition pstop_aux_channel.h:26
#define PSTOP_AUX_BYTE_MASK
Mask for one byte of padding1.
Definition pstop_aux_channel.h:28
#define PSTOP_AUX_UP_VERSION
Schema version stored in padding1 bits 0..7.
Definition pstop_aux_channel.h:24
The machine side of the protocol: connected remotes, application callbacks, and robot state.
Definition machine.h:69
robot_state_t robot_state
Current stop/restart state.
Definition machine.h:78
pstop_remotes_t remotes
Remote slots tracked by this machine.
Definition machine.h:72
A PSTOP message object.
Definition pstop_msg.h:25
message_type_t message
Type of message.
Definition pstop_msg.h:34
device_id_t id
The UUID of this device.
Definition pstop_msg.h:50
uint32_t padding1
extra padding bytes
Definition pstop_msg.h:77
uint8_t version
Version of this message.
Definition pstop_msg.h:29
State tracked for one remote.
Definition pstop_remote_data.h:26
bool is_stop_only
True if the remote can stop but not restart the robot.
Definition pstop_remote_data.h:38
uint32_t local_remote_id
Local identifier of the remote.
Definition pstop_remote_data.h:29
int restart_state
0 = everything is OK 1 = need stop message 2 = stop received
Definition machine.h:60
uint32_t remote_stop_id
The client ID that caused the robot to stop if stopped.
Definition machine.h:53