Orange-OpenSource / its-client

This Intelligent Transportation Systems (ITS) MQTT client based on the JSon ETSI specification transcription provides a ready to connect project for the mobility (connected and autonomous vehicles, road side units, vulnerable road users,...). Let's connect your device or application to our Intelligent Transport Systems (ITS) platform!
MIT License
7 stars 8 forks source link

java/iot3mobility: fix topic root for mobility messages publication #191

Closed mathieu1fb closed 1 month ago

mathieu1fb commented 1 month ago

Fixes;

IoT3 Mobility SDK: Fix topic root for CAM, DENM and CPM publication : it is now correctly set according to the "context" parameter.


How to test

  1. Clone the its-client project on your IDE.

  2. Ensure that you have Gradle to be able to build the java/iot3 modules (core, mobility and examples).

  3. Find the Iot3MobilityExample class in the examples module, and set appropriate values for the following fields:

    private static final String EXAMPLE_UUID = "uuid";
    private static final String EXAMPLE_CONTEXT = "context"; // this will be used as the topic root
    // MQTT parameters
    private static final String EXAMPLE_MQTT_HOST = "mqtt_host";
    private static final int EXAMPLE_MQTT_PORT = 1883;
    private static final String EXAMPLE_MQTT_USERNAME = "mqtt_username";
    private static final String EXAMPLE_MQTT_PASSWORD = "mqtt_password";
    private static final boolean EXAMPLE_MQTT_USE_TLS = false;

    Note: use an MQTT broker paired with an interQueue manager taking care of the inQueue -> outQueue copy.

  4. Run Iot3MobilityExample and check that the mobility messages are published and received with the appropriate topic root (i.e. equal to the "context" parameter).


Expected results:

  1. CAMs should be sent and received at 1 Hz, and visible in the logs.
  2. DENMs should be sent and received every 10 seconds, and visible in the logs.
  3. CPMs should be sent and received at 1 Hz, and visible in the logs.

You can also use the ITSdroid app (with a project code matching the EXAMPLE_CONTEXT value), to visualise the messages at the UTAC TEQMO.

mathieu1fb commented 1 month ago
  • [x] Code review OK

    • [x] Builds OK

    • [ ] Tests

Tests were not done, by lack of a way to run them from the command line; code changes are trivial enough that a code review was deemed enough to validate the change.

I will find a way to make it easily testable from a terminal in the next sprint.