NRFBoundary.hpp 674 Bytes
Newer Older
1
2
#pragma once

3
#include <boundary/communication/MessageBoundary.hpp>
4
5
6
#include <RF24.h>


7
class NRFBoundary: public MessageBoundary {
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    /// The radio used to communicate with the other party
    RF24                      nrfRadio;


public:
    NRFBoundary(uint16_t pin_ce, uint16_t pin_csn, uint8_t channel,  uint64_t readingPipe, uint64_t writingPipe,
                bool enableAutoAck = true, bool enableDynamicPayloads = true, uint8_t staticPayloadLength = 0,
                rf24_pa_dbm_e paLevel = RF24_PA_MIN);

    bool sendMessage(const RobotMessage &command) override;

    bool isMessageAvailable() override;

    ControllerMessage getNextMessage() override;

};