Program Listing for File knx_ip_routing_indication.cpp

Return to documentation for file (src/knx/knx_ip_routing_indication.cpp)

#include "knx_ip_routing_indication.h"
#include <cstring>

#ifdef USE_IP
CemiFrame& KnxIpRoutingIndication::frame()
{
    return _frame;
}


KnxIpRoutingIndication::KnxIpRoutingIndication(uint8_t* data,
        uint16_t length) : KnxIpFrame(data, length), _frame(data + headerLength(), length - headerLength())
{
}

KnxIpRoutingIndication::KnxIpRoutingIndication(CemiFrame frame)
    : KnxIpFrame(frame.totalLenght() + LEN_KNXIP_HEADER), _frame(_data + headerLength(), frame.totalLenght())
{
    serviceTypeIdentifier(RoutingIndication);
    memcpy(_data + LEN_KNXIP_HEADER, frame.data(), frame.totalLenght());
}
#endif