//
// Created by Simon Wörner on 16.06.17.
//

#include "emergency_stop.h"

#include <cstddef>

extern "C" {
void *emergency_stop_init(uint8_t port);
void emergency_stop_clean(void *emergency_stop);
bool emergency_stop_get_state(void *emergency_stop);
}

emergency_stop::emergency_stop(uint8_t port)
{
    rust_emergency_stop = emergency_stop_init(port);
}

emergency_stop::~emergency_stop()
{
    emergency_stop_clean(rust_emergency_stop);
    rust_emergency_stop = NULL;
}

bool emergency_stop::get_state() const
{
    return emergency_stop_get_state(rust_emergency_stop);
}