Skip to content

Commit

Permalink
PR updates
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Jul 11, 2024
1 parent f49a8e1 commit ff4e4f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ int Ntcip1202::getPedestrianSignalGroupForPhase(int phase)
return signalGroupId;
}

long Ntcip1202::getAdjustedTime(unsigned int offset_tenthofSec, unsigned long msEpoch)
long Ntcip1202::getAdjustedTime(unsigned int offset_tenthofSec, unsigned long msEpoch) const
{
// generate J2735 TimeMark which is:
// Tenths of a second in the current or next hour
Expand Down
3 changes: 1 addition & 2 deletions src/v2i-hub/SpatPlugin/src/NTCIP1202.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ struct SignalGroupMapping
class Ntcip1202
{
public:
inline explicit Ntcip1202() {};
void setSignalGroupMappingList(string json);

void copyBytesIntoNtcip1202(char* buff, int numBytes);
Expand Down Expand Up @@ -99,7 +98,7 @@ class Ntcip1202
uint16_t getOverlapMinTime(int phaseNumber);
uint16_t getOverlapMaxTime(int phaseNumber);

long getAdjustedTime(unsigned int offset_tenthofSec, unsigned long msEpoch);
long getAdjustedTime(unsigned int offset_tenthofSec, unsigned long msEpoch) const;

bool isFlashingStatus();
bool isPhaseFlashing();
Expand Down
7 changes: 5 additions & 2 deletions src/v2i-hub/SpatPlugin/src/SpatPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace tmx::utils;

namespace SpatPlugin {

SpatPlugin::SpatPlugin(string name) :PluginClientClockAware(name) {
SpatPlugin::SpatPlugin(const std::string &name) :PluginClientClockAware(name) {
spatReceiverThread = std::make_unique<tmx::utils::ThreadTimer>(std::chrono::milliseconds(5));

if ( PluginClientClockAware::isSimulationMode() ) {
Expand Down Expand Up @@ -92,7 +92,8 @@ namespace SpatPlugin {
spatEncodedMsg.addDsrcMetadata(tmx::messages::api::msgPSID::signalPhaseAndTimingMessage_PSID);

PLOG(tmx::utils::logDEBUG) << "Broadcasting SPAT" << std::endl;
BroadcastMessage(static_cast<routeable_message>(spatEncodedMsg));
auto rMsg = static_cast<routeable_message>(spatEncodedMsg);
BroadcastMessage(rMsg);
}
else if (spatMode == "J2735_HEX") {
auto spatEncoded_ptr = std::make_shared<tmx::messages::SpatEncodedMessage>();
Expand All @@ -109,6 +110,8 @@ namespace SpatPlugin {
catch (const tmx::J2735Exception &e) {
PLOG(tmx::utils::logERROR) << "Encountered J2735 Exception " << e.what() << " attempting to process SPAT." << std::endl
<< e.GetBacktrace();

SetStatus<uint>(keySkippedMessages, skippedMessages++);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/v2i-hub/SpatPlugin/src/SpatPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SpatPlugin: public tmx::utils::PluginClientClockAware {

public:

SpatPlugin(std::string name);
SpatPlugin(const std::string &name);
virtual ~SpatPlugin();


Expand All @@ -50,6 +50,8 @@ class SpatPlugin: public tmx::utils::PluginClientClockAware {
const char* keyConnectionStatus = "Connection Status";

const char* keySkippedMessages = "Skipped Messages";

uint skippedMessages = 0;

bool isConnected = false;

Expand Down

0 comments on commit ff4e4f1

Please sign in to comment.