I am new to Veins and trying to implement a mechanism to detect if the WSM packet was received before. I am using the "psid" as the main variable to identify the packet - is it correct?
Will this type of code work? :
bool MyVeinsApp::msgReceivedBefore(int psid){
/*
This function will be used to determine if the message was received before
and should be discarded or processed further
*/
if(msg_log.find(psid) == msg_log.end()){
return false
}
else {
return true;
}
}
Here msg.log is a C++ data structure storing WSMs based on psid.