Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Nov 30, 2023
1 parent 040a99b commit bf290f5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/docker-compose-vscode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ services:
- SIM_V2X_PORT=5757
- SIM_INTERACTION_PORT=7576
- V2X_PORT=8686
- INFRASTRUCTURE_ID=1
- INFRASTRUCTURE_ID=rsu_<J2735 MAP MESSAGE INTERSECTION ID>
- INFRASTRUCTURE_NAME=<RSU_NAME>
- SENSOR_JSON_FILE_PATH=/var/www/plugins/MAP/sensors.json
secrets:
- mysql_password
Expand Down
2 changes: 2 additions & 0 deletions configuration/amd64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ services:
- db
environment:
- MYSQL_PASSWORD=/run/secrets/mysql_password
- INFRASTRUCTURE_ID=rsu_<J2735 MAP MESSAGE INTERSECTION ID>
- INFRASTRUCTURE_NAME=<RSU_NAME>
secrets:
- mysql_password
volumes:
Expand Down
6 changes: 6 additions & 0 deletions src/tmx/TmxUtils/src/simulation/SimulationEnvUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ namespace tmx::utils::sim{
* for CDASim connection.
*/
constexpr inline static const char *INFRASTRUCTURE_ID = "INFRASTRUCTURE_ID";

/**
* @brief Name of environment variable for storing infrastructure name of v2xhub. Only necessary in SIMULATION MODE
* for CDASim connection.
*/
constexpr inline static const char *INFRASTRUCTURE_NAME = "INFRASTRUCTURE_NAME";
/**
* @brief Function to return bool indicating whether V2X-Hub deployment is in SIMULATION MODE or not.
* @return true if SIMULATION_MODE is "true" or "TRUE" and false otherwise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace TelematicBridge
TelematicBridgePlugin::TelematicBridgePlugin(const string &name) : PluginClient(name)
{
_telematicUnitPtr = make_unique<TelematicUnit>();
_unitId = sim::get_sim_config("INFRASTRUCTURE_ID");
_unitName = sim::get_sim_config("INFRASTRUCTURE_NAME");
PLOG(logERROR) << "_unitId: "<< _unitId;
UpdateConfigSettings();
AddMessageFilter("*", "*", IvpMsgFlags_None);
AddMessageFilter("J2735", "*", IvpMsgFlags_RouteDSRC);
Expand Down Expand Up @@ -45,8 +48,6 @@ namespace TelematicBridge
{
lock_guard<mutex> lock(_configMutex);
GetConfigValue<string>("NATSUrl", _natsURL);
GetConfigValue<string>("UnitId", _unitId);
GetConfigValue<string>("UnitName", _unitName);
GetConfigValue<string>("MessageExclusionList", _excludedMessages);
unit_st unit = {_unitId, _unitName, UNIT_TYPE_INFRASTRUCTURE};
if (_telematicUnitPtr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "PluginClient.h"
#include "TelematicBridgeMsgWorker.h"
#include "TelematicUnit.h"
#include <simulation/SimulationEnvUtils.h>


namespace TelematicBridge
Expand Down

0 comments on commit bf290f5

Please sign in to comment.