#ifndef CaiXianlinRF_h
#define CaiXianlinRF_h

#include <Arduino.h>

// Delay in microseconds for different pulses
#define CAIXIANLIN_SYNC_TIME 1200
#define CAIXIANLIN_LONG_TIME 800
#define CAIXIANLIN_SHORT_TIME 200

namespace CaiXianlin {
    enum MessageType {
        _,
        SHOCK,
        VIBRATE,
        BEEP,
        LIGHT
    };

    class Transmitter {
        public:
            Transmitter(int pin);
            void transmit(uint16_t transmitterID, uint8_t channel, MessageType command, uint8_t intensity=0, bool lucalEncode=false);
            void transmit(uint64_t data);
        private:
            int _pin;
            bool _lastState;
            void _toggle();
            bool _pulses[86]; // Holds if a pulse is short (false) or long (true)
    };
}

#endif // header define