motor
This commit is contained in:
parent
b2a7f2ab20
commit
ffd024bf23
|
@ -445,7 +445,9 @@ namespace ratgdo {
|
|||
sendLockStatus();
|
||||
if (this->obstructionState != this->previousObstructionState)
|
||||
sendObstructionStatus();
|
||||
|
||||
if (this->motorState != this->previousMotorState) {
|
||||
sendMotorStatus();
|
||||
}
|
||||
if (this->motionState == MotionState::MOTION_STATE_DETECTED) {
|
||||
sendMotionStatus();
|
||||
this->motionState = MotionState::MOTION_STATE_CLEAR;
|
||||
|
|
|
@ -80,10 +80,11 @@ namespace ratgdo {
|
|||
uint8_t previousLightState { LightState::LIGHT_STATE_UNKNOWN };
|
||||
uint8_t previousLockState { LockState::LOCK_STATE_UNKNOWN };
|
||||
uint8_t previousObstructionState { ObstructionState::OBSTRUCTION_STATE_UNKNOWN };
|
||||
uint8_t previousMotorState { MotorState::MOTOR_STATE_UNKNOWN };
|
||||
|
||||
uint8_t obstructionState { ObstructionState::OBSTRUCTION_STATE_UNKNOWN };
|
||||
uint8_t motionState { MotionState::MOTION_STATE_CLEAR };
|
||||
uint8_t motorState { MotorState::MOTOR_STATE_OFF };
|
||||
uint8_t motorState { MotorState::MOTOR_STATE_UNKNOWN };
|
||||
uint8_t lockState { LockState::LOCK_STATE_UNKNOWN };
|
||||
uint8_t lightState { LightState::LIGHT_STATE_UNKNOWN };
|
||||
uint8_t doorState { DoorState::DOOR_STATE_UNKNOWN };
|
||||
|
|
|
@ -68,8 +68,9 @@ namespace ratgdo {
|
|||
case MOTOR_STATE_ON:
|
||||
return "ON";
|
||||
case MOTOR_STATE_OFF:
|
||||
default:
|
||||
return "OFF";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ namespace ratgdo {
|
|||
enum MotorState : uint8_t {
|
||||
MOTOR_STATE_OFF = 0,
|
||||
MOTOR_STATE_ON = 1,
|
||||
MOTOR_STATE_UNKNOWN = 2,
|
||||
};
|
||||
const char* motor_state_to_string(MotorState state);
|
||||
|
||||
|
|
Loading…
Reference in New Issue