15 lines
473 B
C++
15 lines
473 B
C++
#pragma once
|
|
#include <vector>
|
|
#include <stdint.h>
|
|
|
|
class Dcc {
|
|
public:
|
|
// Generate a simplified DCC accessory packet (bytes).
|
|
// addr: accessory address (application-dependent)
|
|
// activate: true = ON, false = OFF
|
|
static std::vector<uint8_t> generateAccessoryPacket(uint16_t addr, bool activate);
|
|
|
|
// Send packet via a GPIO pin (simulation/pulse). Implementation may be hardware-specific.
|
|
static void sendPacket(const std::vector<uint8_t> &packet, int pin);
|
|
};
|