Quantcast
Channel: MultiTech Developer Resources » All Posts
Viewing all articles
Browse latest Browse all 7111

Reply To: [Solved] Need help receiving downlinks in Serial Data Mode

$
0
0

CommandTerminal.cpp shows the code for a received packet. It should write to the serial port when in serial data mode and a packet is received with port != 0.
You should also see debug output for the number of bytes received for each packet.


void CommandTerminal::RadioEvent::PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries, uint32_t address) {
    mDotEvent::PacketRx(port, payload, size, rssi, snr, ctrl, slot, retries, address);

    if (serial_data_mode && port != 0) {
        logDebug("Rx %d bytes", size);
        if (size > 0) {
            CommandTerminal::Serial()->write((char*) RxPayload, RxPayloadSize);
        }
        if (!CommandTerminal::Serial()->readable() && _dot->getAckRequested() && _dot->getClass() == "C") {
            _sendAck = true;
        }
    }
}

Viewing all articles
Browse latest Browse all 7111

Trending Articles