You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
640 B

/*
* Command.hpp
*
* Created on: Jul 8, 2021
* Author: Andreas Berthoud
*/
#ifndef SRC_COMMAND_H_
#define SRC_COMMAND_H_
#include <stdint.h>
extern "C" void pop_and_execute_commands();
typedef enum : uint8_t {
COMMAND_NONE = 0,
COMMAND_LOG = 0xff,
} CommandId;
class Command {
public:
CommandId id;
Command(CommandId command_id);
virtual void send();
protected:
uint8_t data[512];
uint8_t * payload_ptr;
const int max_payload_length = 507;
void set_payload_length(uint16_t length);
private:
uint16_t payload_length;
};
void push_command(const Command &command);
#endif /* SRC_COMMAND_H_ */