Skip to content

Commit

Permalink
feat(file-output): add Message as an extended method for V2xMessageRe…
Browse files Browse the repository at this point in the history
…ception (#400)

* feat(file-output): add Payload as an extended method for V2xMessageReception
* feat(file-output): add Message as an extended method for V2xMessageReception
* clean: re-order methods to please checkstyle
  • Loading branch information
kschrab authored Aug 8, 2024
1 parent 8d8f70d commit 3502596
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<entry>MessageId</entry>
<entry>ReceiverName</entry>
<entry>ReceiverInformation.ReceiveSignalStrength</entry>
<entry>Message.Payload.EffectiveLength</entry>
</entries>
</subscription>
<subscription id="V2xMessageTransmission">
Expand All @@ -66,6 +67,7 @@
<entry>Message.Routing.Destination.Type</entry>
<entry>Message.Routing.Destination.Address.IPv4Address</entry>
<entry>Message.Routing.Destination.AdhocChannelId</entry>
<entry>Message.Payload.EffectiveLength</entry>
</entries>
</subscription>
<subscription id="VehicleRegistration" enabled="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,26 @@ public static void putV2xMessage(V2xMessage message) {
V2X_MESSAGES.put(message.getId(), message);
}

static public Object getType(V2xMessageReception interaction) {
static public Object getType(V2xMessageTransmission interaction) {
V2xMessage message = Objects.requireNonNull(V2X_MESSAGES.get(interaction.getMessageId()));
if (message instanceof GenericV2xMessage) {
return ((GenericV2xMessage) message).getMessageType();
}
return message.getSimpleClassName();
}

static public Object getType(V2xMessageTransmission interaction) {
static public Object getType(V2xMessageReception interaction) {
V2xMessage message = Objects.requireNonNull(V2X_MESSAGES.get(interaction.getMessageId()));
if (message instanceof GenericV2xMessage) {
return ((GenericV2xMessage) message).getMessageType();
}
return message.getSimpleClassName();
}

static public V2xMessage getMessage(V2xMessageReception interaction) {
return Objects.requireNonNull(V2X_MESSAGES.get(interaction.getMessageId()));
}

static public Object getTimeInSec(Interaction interaction) {
return interaction == null ? "" : interaction.getTime() / TIME.SECOND;
}
Expand Down

0 comments on commit 3502596

Please sign in to comment.