Esempio n. 1
0
void radioRxHandler(rtp::packet pkt) {
    LOG(INF3, "radioRxHandler()");
    // write packet content (including header) out to EPBULK_IN
    vector<uint8_t> buf;
    pkt.pack(&buf);

    // drop the packet if it's the wrong size. Thsi will need to be changed if
    // we have variable-sized reply packets
    if (buf.size() != rtp::Reverse_Size) {
        LOG(WARN, "Dropping packet, wrong size '%u', should be '%u'",
            buf.size(), rtp::Reverse_Size);
        return;
    }

    bool success = usbLink.writeNB(EPBULK_IN, buf.data(), buf.size(),
                                   MAX_PACKET_SIZE_EPBULK);

    // TODO(justin): add this message back in. For some reason, the usb system
    // reports failure *unless* I add a print statement inside
    // USBDevice.writeNB() after result = endpointWrite().  No idea why this is
    // the case
    //
    // if (!success) LOG(WARN, "Failed to transfer received %u byte packet over
    // usb", pkt.payload.size());
}
Esempio n. 2
0
void radioRxHandler(rtp::packet pkt) {
    LOG(INF3, "radioRxHandler()");
    // write packet content (including header) out to EPBULK_IN
    vector<uint8_t> buf;
    pkt.pack(&buf);
    bool success = usbLink.writeNB(EPBULK_IN, buf.data(), buf.size(),
                                   MAX_PACKET_SIZE_EPBULK);

    // TODO(justin): add this message back in. For some reason, the usb system
    // reports failure *unless* I add a print statement inside
    // USBDevice.writeNB() after result = endpointWrite().  No idea why this is
    // the case
    //
    // if (!success) LOG(WARN, "Failed to transfer received %u byte packet over
    // usb", pkt.payload.size());
}