Newer
Older
void BTPLayer::sendMsg(const LibItsBtp__TypesAndValues::BtpPacket& m, const Params& params){
sendData(data, Params());
}
void BTPLayer::sendData(const OCTETSTRING& data, const Params& params){
sendToAllLayers(data, params);
}
void BTPLayer::receiveData(const OCTETSTRING& data, const Params& info)
{
LibItsBtp__TypesAndValues::BtpPacket p;
_codec.decode(data, p);
receiveToAllPorts(p, info);
if(p.payload().is_present()){
receiveToAllLayers(p.payload()().rawPayload(), info);
}
}
class BTPFactory : public LayerFactory {
static BTPFactory _f;
public:
BTPFactory();
virtual Layer * createLayer(const std::string & type, const std::string & param);
};
BTPFactory::BTPFactory()
{
// register factory
StackFactory::getInstance()->registerLayerFactory("BTP", this);