riebl / artery

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
204 stars 132 forks source link

Extracting CAM message fields #256

Closed ansb5 closed 2 years ago

ansb5 commented 2 years ago

The position is in CAM's basic container, see its referencePosition field: cam->asn1()->cam.camParameters.basicContainer.referencePosition Please open a new issue ticket if you have a specific question.

Originally posted by @riebl in https://github.com/riebl/artery/issues/114#issuecomment-1200247755

Hi @riebl

Thank you for your answer. My intention was to extract the field inside CaService in the indicate() function, which is where the package arrives. It would be the right place to do that right?

riebl commented 2 years ago

Yes, you can do that in CaService::indicate. Alternatively, you can listen to the CamReceived signal emitted by the CaService. This signal conveys a CaObject for every received CAM. Thus, you can access the full CAM in any module listening to this signal.

ansb5 commented 2 years ago

Hello @riebl thank you for your answer.

I'm trying to extract the data as you say using cam->asn1()->cam.camParameters.basicContainer.referencePosition but I can't get it. In CaService::indicate there is a object cam. Is that cam where I have to do cam->asn1()->

And on the other hand, in the other option that you suggest, I see how inCaService::indicate the signal that you said is emitted by emit(scSignalCamReceived, &obj). If I want to extract the information in CaService::indicate (supposing that in .ned it is already defined what I wanted to extract) how would I have to extract it? And I would have to extract it from scSiganlCamReceived no? Or from obj?

ansb5 commented 2 years ago

I tried this inside the CaService::indicate function and it worked: (*cam)->cam.camParameters.basicContainer.referencePosition