Skip to content

Commit

Permalink
Implemented priority & options NTCIP1218 SNMP operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccoystephenson committed Jul 10, 2023
1 parent 93f85ba commit 8b964e9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class SnmpNTCIP1218Protocol {
public static String rsu_msg_repeat_payload_oid = ntcip1218prefix + srm_prefix + ".7"; // Section 5.4.2.7
public static String rsu_msg_repeat_enable_oid = ntcip1218prefix + srm_prefix + ".8"; // Section 5.4.2.8
public static String rsu_msg_repeat_status_oid = ntcip1218prefix + srm_prefix + ".9"; // Section 5.4.2.9

// sections 5.4.2.10 (priority) & 5.4.2.11 (options) are not implemented
public static String rsu_msg_repeat_priority_oid = ntcip1218prefix + srm_prefix + ".10"; // Section 5.4.2.10
public static String rsu_msg_repeat_options_oid = ntcip1218prefix + srm_prefix + ".11"; // Section 5.4.2.11

// pdm is not defined in NTCIP1218
}
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private static ScopedPDU createPDUWithNTCIP1218Protocol(SNMP snmp, String payloa
// rsuMsgRepeatPsid.3 x "8300"
// --> 1.3.6.1.4.1.1206.4.2.18.3.2.1.2.3 x "8300"
// rsuMsgRepeatTxChannel.3 = 3
// --> 1.3.6.1.4.1.1206.4.2.18.3.2.1.3.3 = 178
// --> 1.3.6.1.4.1.1206.4.2.18.3.2.1.3.3 = 183
// rsuMsgRepeatTxInterval.3 = 1
// --> 1.3.6.1.4.1.1206.4.2.18.3.2.1.4.3 = 1
// rsuMsgRepeatDeliveryStart.3 x "010114111530"
Expand Down Expand Up @@ -458,6 +458,16 @@ private static ScopedPDU createPDUWithNTCIP1218Protocol(SNMP snmp, String payloa
new Integer32(snmp.getStatus())
);

VariableBinding rsuMsgRepeatPriority = new VariableBinding(
new OID(SnmpNTCIP1218Protocol.rsu_msg_repeat_priority_oid.concat(".").concat(Integer.toString(index))),
new Integer32(6)
);

VariableBinding rsuMsgRepeatOptions = new VariableBinding(
new OID(SnmpNTCIP1218Protocol.rsu_msg_repeat_options_oid.concat(".").concat(Integer.toString(index))),
new OctetString("00")
);

ScopedPDU pdu = new ScopedPDU();
pdu.add(rsuMsgRepeatPsid);
pdu.add(rsuMsgRepeatTxChannel);
Expand All @@ -469,6 +479,8 @@ private static ScopedPDU createPDUWithNTCIP1218Protocol(SNMP snmp, String payloa
if (verb == ServiceRequest.OdeInternal.RequestVerb.POST) {
pdu.add(rsuMsgRepeatStatus);
}
pdu.add(rsuMsgRepeatPriority);
pdu.add(rsuMsgRepeatOptions);
pdu.setType(PDU.SET);

return pdu;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ public void shouldCreatePDUWithFourDot1Protocol() throws ParseException {

@Test
public void shouldCreatePDUWithNTCIP1218Protocol() throws ParseException {
String expectedResult = "[1.3.6.1.4.1.1206.4.2.18.3.2.1.2.3 = 80:03, 1.3.6.1.4.1.1206.4.2.18.3.2.1.3.3 = 4, 1.3.6.1.4.1.1206.4.2.18.3.2.1.4.3 = 5, 1.3.6.1.4.1.1206.4.2.18.3.2.1.5.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.6.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.7.3 = 88, 1.3.6.1.4.1.1206.4.2.18.3.2.1.8.3 = 9, 1.3.6.1.4.1.1206.4.2.18.3.2.1.9.3 = 10]";
String expectedResult2 = "[1.3.6.1.4.1.1206.4.2.18.3.2.1.2.3 = 80:03, 1.3.6.1.4.1.1206.4.2.18.3.2.1.3.3 = 4, 1.3.6.1.4.1.1206.4.2.18.3.2.1.4.3 = 5, 1.3.6.1.4.1.1206.4.2.18.3.2.1.5.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.6.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.7.3 = 88, 1.3.6.1.4.1.1206.4.2.18.3.2.1.8.3 = 9]";
String expectedResult = "[1.3.6.1.4.1.1206.4.2.18.3.2.1.2.3 = 80:03, 1.3.6.1.4.1.1206.4.2.18.3.2.1.3.3 = 4, 1.3.6.1.4.1.1206.4.2.18.3.2.1.4.3 = 5, 1.3.6.1.4.1.1206.4.2.18.3.2.1.5.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.6.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.7.3 = 88, 1.3.6.1.4.1.1206.4.2.18.3.2.1.8.3 = 9, 1.3.6.1.4.1.1206.4.2.18.3.2.1.9.3 = 10, 1.3.6.1.4.1.1206.4.2.18.3.2.1.10.3 = 6, 1.3.6.1.4.1.1206.4.2.18.3.2.1.11.3 = 00]";
String expectedResult2 = "[1.3.6.1.4.1.1206.4.2.18.3.2.1.2.3 = 80:03, 1.3.6.1.4.1.1206.4.2.18.3.2.1.3.3 = 4, 1.3.6.1.4.1.1206.4.2.18.3.2.1.4.3 = 5, 1.3.6.1.4.1.1206.4.2.18.3.2.1.5.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.6.3 = 07:e1:0c:02:11:2f, 1.3.6.1.4.1.1206.4.2.18.3.2.1.7.3 = 88, 1.3.6.1.4.1.1206.4.2.18.3.2.1.8.3 = 9, 1.3.6.1.4.1.1206.4.2.18.3.2.1.10.3 = 6, 1.3.6.1.4.1.1206.4.2.18.3.2.1.11.3 = 00]";

String rsuSRMPsid = "00000083";
int rsuSRMTxChannel = 4;
Expand Down

0 comments on commit 8b964e9

Please sign in to comment.