6 #define T_GenCamMin 100 7 #define T_GenCamMax 1000 38 qDebug() <<
"caBasicService start!\n";
109 msgLength = (rval.
encoded + 7) / 8;
126 QByteArray payload(cam, camLength);
148 qDebug() <<
"Message sent to the ITS networking & transport layer:";
150 qDebug() <<
"Of size" << camLength;
174 int minH =
MIN(prevH, currentH), maxH = minH == prevH ? currentH : prevH,
175 offsetH =
MIN((maxH - minH), (3600 - maxH + minH));
207 basicVehicleContainerHighFrequency.speed.speedValue) > 50)
357 memset (&r, 0,
sizeof r);
371 if(abs(QTime::currentTime().msecsTo(
lastLF())) >= 500)
599 ret.list.array = (
PathPoint_t**)calloc(1,
sizeof *ret.list.array);
607 ret.list.array[i] = (
PathPoint_t*)calloc(1,
sizeof *ret.list.array[i]);
PathPoint_t m_listPathPoint[MAX_REFERENCEPOSITION]
SpecialTransportContainer_t specialTransportContainer
HighFrequencyContainer_t make_HighFrequencyContainer(HighFrequencyContainer_PR present)
make_HighFrequencyContainer Make a default HighFrequencyContainer_t.
CurvatureCalculationMode_t curvatureCalculationMode() const
curvatureCalculationMode Curvature calculation mode getter.
gnDataRequest_t structure is the GN data request definition.
LifeTime * maximumPacketLifeTime
PathHistory_t getPathHistory()
getPathHistory PathHistory getter.
quint16 * repetitionInterval
#define itsGnDefaultTrafficClass
struct CauseCode * incidentIndication
CamParameters_t camParameters
VehicleRole_t vehicleRole
bool checkForOptionalContainers()
checkForOptionalContainers Check if there need optional data.
HighFrequencyContainer_PR present
void setLastLF(QTime l)
setLastLF Set the time where the last CAM had a LowFrequencyContainer.
void execute()
execute Slot used for the first loop.
struct asn_TYPE_descriptor_s * failed_type
DriveDirection_t driveDirection
EmbarkationStatus_t embarkationStatus
StationType_t stationType
RoadworksSubCauseCode_t * roadworksSubCauseCode
RescueContainer_t make_RescueContainer()
make_RescueContainer Make a default RescueContainer_t.
struct VerticalAcceleration * verticalAcceleration
RoadworksSubCauseCode_t * roadworksSubCauseCode() const
roadworksSubCauseCode Roadworks cause code getter.
quint16 * maximumRepetitionTime
struct SpecialVehicleContainer * specialVehicleContainer
PublicTransportContainer_t make_PublicTransportContainer()
make_PublicTransportContainer Make a default PublicTransportContainer_t.
LowFrequencyContainer_PR present
asn_TYPE_descriptor_t asn_DEF_CAM
AccelerationControl_t * accelerationControl() const
accelerationControl Acceleration control getter.
FakeGPSProvider * m_paramGPS
HighFrequencyContainer_t highFrequencyContainer
EmergencyContainer_t emergencyContainer
void PassCamToNetworkAndTransportLayer(char *cam, int camLength)
PassCamToNetworkAndTransportLayer Pass the encoded CAM to the N&T layer.
CAM_t previousCAM() const
previousCAM Previous CAM getter
SpecialVehicleContainer_t collectOptionalData_SpecialVehicleContainer(VehicleRole_t v)
collectOptionalData_SpecialVehicleContainer Collect optional data for the SpecialVehicleContainer.
ProtectedCommunicationZonesRSU_t * protectedCommunicationZones() const
protectedCommunicationZones Protected communicaiton zones getter.
double dist(qint32 x1, qint32 y1, qint32 x2, qint32 y2)
dist This function calculate the euclidian distance between two points ([x1, y1], [x2...
quint16 T_GenCam_DCC() const
T_GenCam_DCC T_GenCam_DCC getter.
SpecialTransportContainer_t make_SpecialTransportContainer()
make_SpecialTransportContainer Make a default SpecialTransportContainer_t.
AccelerationControl_t * accelerationControl
PerformanceClass_t * performanceClass
QList< GenerationDeltaTime_t > m_listGenerationDeltaTime
BasicVehicleContainerLowFrequency_t basicVehicleContainerLowFrequency
VehicleWidth_t vehicleWidth
bool checkCamGeneration()
checkCamGeneration Check if a CAM needs to be generated.
CauseCode_t * causeCodeEmergency() const
causeCodeEmergency Emergency cause code getter.
LightBarSirenInUse_t lightBarSirenInUse
FakeCANProvider * m_paramCAN
EmergencyPriority_t * emergencyPriority
SpecialTransportType_t specialTransportType
VerticalAcceleration_t * verticalAcceleration() const
verticalAcceleration Vertical acceleration getter.
EmergencyPriority_t * emergencyPriority() const
emergencyPriority Emergency priority getter.
YawRate_t yawRate() const
yawRate Yaw rate getter.
quint64 timestamp()
timestamp Timestamp getter.
RoadWorksContainerBasic_t collectOptionalData_RoadWorksContainerbasic()
collectOptionalData_RoadWorksContainerbasic Collect optional data for the RoadWorksContainerBasic.
PathHistory_t pathHistory
VehicleRole_t vehicleRole() const
vehicleRole Vehicle role getter.
VehicleLength_t vehicleLength() const
vehicleLength Vehicle length getter.
FakeApplicationProvider * m_paramAppli
EmergencyContainer_t collectOptionalData_EmergencyContainer()
collectOptionalData_EmergencyContainer Collect optional data for the EmergencyContainer.
struct LowFrequencyContainer * lowFrequencyContainer
SteeringWheelAngle_t * steeringWheelAngle() const
steeringWheelAngle Steering wheel angle getter.
ParameterCAN & data()
data CAN bus data getter.
BasicVehicleContainerLowFrequency_t collectOptionalData_BasicVehicleContainerLowFrequency()
collectOptionalData_BasicVehicleContainerLowFrequency Collect optional data for the BasicVehicleConta...
AccelerationControl_t cpy_AccelerationControl(AccelerationControl_t a)
cpy_AccelerationControl Make a copy of an AccelerationControl_t.
union LowFrequencyContainer::LowFrequencyContainer_u choice
ClosedLanes_t * closedLanes() const
closedLanes Closed lanes getter.
bool needSpecialVehicleContainer(VehicleRole_t role)
needSpecialVehicleContainer Check if there need SpecialVehicleContainer.
TrafficRule_t * trafficRule
SpecialTransportContainer_t collectOptionalData_SpecialTransportContainer()
collectOptionalData_SpecialTransportContainer Collect optional data for the SpecialTransportContainer...
DriveDirection_t driveDirection() const
driveDirection Drive direction getter.
CAM_t cpy_CAM(CAM_t c)
cpy_CAM Make a copy of a CAM_t.
TrafficRule_t * trafficRule() const
trafficRule Traffic rule getter.
struct ClosedLanes * closedLanes
LateralAcceleration_t * lateralAcceleration() const
lateralAcceleration Lateral acceleration getter.
ExteriorLights_t exteriorLights() const
exteriorLights Exterior lights status getter.
struct LateralAcceleration * lateralAcceleration
DeltaLatitude_t deltaLatitude
CAM_t collectMandatoryData()
collectMandatoryData Collect the CAM mandatory data.
VehicleWidth_t vehicleWidth() const
vehicleWidth Vehicle width getter.
LongitudinalAcceleration_t longitudinalAcceleration() const
longitudinalAcceleration Longitudinal acceleration getter.
BasicContainer_t basicContainer
HeadingValue_t headingValue
void checkToSendCAM()
checkToSendCAM Slot used when there need to check if we need to send CAM.
PathDeltaTime_t * pathDeltaTime
ParameterConfiguration * m_paramConf
SpecialTransportType_t specialTransportType() const
specialTransportType Special transport type getter.
struct CauseCode * incidentIndication
RSUContainerHighFrequency_t rsuContainerHighFrequency
GenerationDeltaTime_t generationDeltaTime
VerticalAcceleration_t cpy_VerticalAcceleration(VerticalAcceleration_t v)
cpy_VerticalAcceleration Make a copy of a VerticalAcceleration_t.
ParameterGPS & data()
data GPS data getter.
CommonHeader::e_upperProtocolEntity upperProtocolEntity
SpeedLimit_t * speedLimit
SafetyCarContainer_t safetyCarContainer
BasicContainer_t collectMandatoryData_BasicContainer()
collectMandatoryData_BasicContainer Collect mandatory data for the BasicContainer.
DangerousGoodsContainer_t dangerousGoodsContainer
void checkPathPoint(int i)
checkPathPoint Check a PathPoint.
LateralAcceleration_t cpy_LateralAcceleration(LateralAcceleration_t l)
cpy_LateralAcceleration Make a copy of a LateralAcceleration_t.
ExteriorLights_t exteriorLights
QTime lastLF() const
lastLF Last time where a CAM had a LowFrequencyContainer.
AltitudeValue_t altitudeValue
PtActivation_t * ptActivation() const
ptActivation Priority activation getter.
LightBarSirenInUse_t lightBarSirenInUse
RoadWorksContainerBasic_t roadWorksContainerBasic
CAM_t make_CAM()
make_CAM Make a default CAM_t.
QList< ReferencePosition_t > m_listReferencePosition
RoadWorksContainerBasic_t make_RoadWorksContainerBasic()
make_RoadWorksContainerBasic Make a default RoadWorksContainerBasic_t.
LongitudinalAcceleration_t longitudinalAcceleration
destinationAddress_t destinationAddress
struct SteeringWheelAngle * steeringWheelAngle
quint8 packetTransportSubType
StationType_t stationType() const
stationType Station type getter.
#define DEFAULT_N_GEN_CAM
DangerousGoodsBasic_t dangerousGoodsBasic() const
dangerousGoodsBasic Dangerous goods for CAM getter.
void setPreviousTime(QTime p)
setPreviousTime Set the time where the previous CAM was sent.
union HighFrequencyContainer::HighFrequencyContainer_u choice
Speed_t speed() const
speed ITS-S speed getter.
BasicVehicleContainerHighFrequency_t basicVehicleContainerHighFrequency
ReferencePosition_t referencePosition() const
referencePosition ITS-S position getter.
void setT_CheckGenCam(quint16 t)
setT_CheckGenCam Set the T_CheckGenCam.
LanePosition_t * lanePosition
asn_enc_rval_t uper_encode_to_buffer(struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, void *buffer, size_t buffer_size)
PublicTransportContainer_t publicTransportContainer
SafetyCarContainer_t collectOptionalData_SafetyCarContainer()
collectOptionalData_SafetyCarContainer Collect optional data for the SafetyCarContainer.
SpecialVehicleContainer_PR present
StationID_t stationID() const
stationID Station ID getter.
union SpecialVehicleContainer::SpecialVehicleContainer_u choice
ReferencePosition_t referencePosition
BasicContainer_t make_BasicContainer()
make_BasicContainer Make a default BasicContainer_t.
struct CenDsrcTollingZone * cenDsrcTollingZone
DeltaAltitude_t deltaAltitude
ParameterApplication & data()
data Returns the vehicle status.
CommonHeader::e_headerType packetTransportType
e_destinationAddress_PR_present present
EmergencyContainer_t make_EmergencyContainer()
make_EmergencyContainer Make a default EmergencyContainer_t.
PathPoint_t getPathPoint(int i)
getPathPoint PathPoint getter.
BasicVehicleContainerHighFrequency_t collectMandatoryData_BasicVehicleContainerHighFrequency()
collectMandatoryData_BasicVehicleContainerHighFrequency Collect mandatory data for the BasicVehicleCo...
CurvatureCalculationMode_t curvatureCalculationMode
RescueContainer_t collectOptionalData_RescueContainer()
collectOptionalData_RescueContainer Collect optional data for the RescueContainer.
quint16 destinationPortInfo
BasicVehicleContainerLowFrequency_t make_BasicVehicleContainerLowFrequency()
make_BasicVehicleContainerLowFrequency Make a default BasicVehicleContainerLowFrequency_t.
PublicTransportContainer_t collectOptionalData_PublicTransportContainer()
collectOptionalData_PublicTransportContainer Collect optional data for the PublicTransportContainer.
SpeedLimit_t * speedLimit() const
speedLimit Speed limit getter.
struct PtActivation * ptActivation
int send(gnDataRequest_t gnDR)
send Creates the BTP and then select the correct packet send option.
caBasicService(GeoNet *geonet, FakeGPSProvider *paramGPS, ParameterConfiguration *paramConf, FakeApplicationProvider *paramAppli, FakeCANProvider *paramCAN)
caBasicService caBasicService constructor.
void checkAndCollectDataForOptionalContainers(CAM_t *cam)
checkAndCollectDataForOptionalContainers Check and collect data for optional containers.
DangerousGoodsContainer_t collectOptionalData_DangerousGoodsContainer()
collectOptionalData_DangerousGoodsContainer Collect optional data for the DangerousGoodsContainer.
Heading_t heading() const
heading ITS-S heading getter.
void setN_GenCam(quint16 n)
setN_GenCam Set the N_GenCam
SafetyCarContainer_t make_SafetyCarContainer()
make_SafetyCarContainer Make a default SafetyCarContainer_t.
e_gnCommunicationProfile gnCommunicationProfile
DangerousGoodsBasic_t dangerousGoodsBasic
DangerousGoodsContainer_t make_DangerousGoodsContainer()
make_DangerousGoodsContainer Make a default DangerousGoodsContainer_t.
RescueContainer_t rescueContainer
LightBarSirenInUse_t lightBarSirenInUse() const
lightBarSirenInUse Light bar and siren status getter.
void utInitialize()
utInitialize Initialize the CA Basic Service.
RSUContainerHighFrequency_t collectMandatoryData_RSUContainerHighFrequency()
collectMandatoryData_RSUContainerHighFrequency Collect mandatory data for the RSUContainerHighFrequen...
LightBarSirenInUse_t lightBarSirenInUse
TrafficClass trafficClass
struct ProtectedCommunicationZonesRSU * protectedCommunicationZonesRSU
CauseCode_t * causeCodeSafety() const
causeCodeSafety Safety car cause code getter.
BasicVehicleContainerHighFrequency_t make_BasicVehicleContainerHighFrequency()
make_BasicVehicleContainerHighFrequency Make a default BasicVehicleContainerHighFrequency_t.
#define MAX_REFERENCEPOSITION
Curvature_t curvature() const
curvature Curvature getter.
LightBarSirenInUse_t lightBarSirenInUse
EmbarkationStatus_t embarkationStatus() const
embarkationStatus Embarkation status getter.
DeltaLongitude_t deltaLongitude
LightBarSirenInUse_t lightBarSirenInUse
DeltaReferencePosition_t pathPosition
VehicleLength_t vehicleLength