ReturnCommand.hpp 413 Bytes
Newer Older
Niels Post's avatar
Niels Post committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <cstdint>
#include <cstdio>

enum class ReturnCode : uint8_t {
    SUCCESS        = 0,
    ROBOT_BUSY     = 1,
    HARDWARE_ERROR = 2,
    MOTOR_STALL    = 3,
    BAD_PARAMETERS = 4,
    NO_SUCH_SENSOR = 5
};

struct ReturnCommand {
    uint8_t message_id;
    ReturnCode returnCode;
    uint8_t data[4];

    ReturnCommand(uint8_t messageId, ReturnCode returnCode, const uint8_t *dat);
};