Created
October 4, 2018 11:23
-
-
Save MounaKaroui/ea65ce3d69975f07f21858a5e8011ffd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DenService::verifyStation() | |
{ | |
cModule* mid=getParentModule(); | |
std::string name= mid->getFullPath(); | |
if(name.find("rsu")!=std::string::npos) | |
{ | |
sendFromRSU=true; | |
rsuId=mid->getParentModule()->getId(); | |
} | |
else | |
{ | |
sendFromRSU=false; | |
} | |
} | |
void DenService::indicate(const vanetza::btp::DataIndication& indication, std::unique_ptr<vanetza::UpPacket> packet) | |
{ | |
Asn1PacketVisitor<vanetza::asn1::Denm> visitor; | |
const vanetza::asn1::Denm* denm = boost::apply_visitor(visitor, *packet); | |
verifyStation(); | |
long egoStationID; | |
if(sendFromRSU) | |
{ | |
egoStationID=rsuId; | |
} | |
else | |
{ | |
egoStationID = getFacilities().get_const<VehicleDataProvider>().station_id(); | |
} | |
if (denm && (*denm)->header.stationID != egoStationID) { | |
DenmObject obj = visitor.shared_wrapper; | |
mMemory->received(obj); | |
emit(denmReceivedSignal, &obj); | |
for (auto& use_case : mUseCases) { | |
use_case.indicate(obj); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment