Skip to content

Commit 4e37320

Browse files
Update datatypes to latest version of spec
1 parent 06df262 commit 4e37320

File tree

6 files changed

+35
-22
lines changed

6 files changed

+35
-22
lines changed

Development/nmos/control_protocol_resource.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ namespace nmos
751751
}
752752

753753
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor
754-
web::json::value make_receiver_monitor(const nc_class_id& class_id, nc_oid oid, bool constant_oid, nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints, bool enabled, nc_overall_status::status overall_status, const utility::string_t& overall_status_message, nc_link_status::status link_status, const utility::string_t& link_status_message, nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_synchronization_status::status synchronization_status, const utility::string_t& synchronization_status_message, const utility::string_t& grand_master_clock_id, nc_stream_status::status stream_status, const utility::string_t& stream_status_message)
754+
web::json::value make_receiver_monitor(const nc_class_id& class_id, nc_oid oid, bool constant_oid, nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints, bool enabled, nc_overall_status::status overall_status, const utility::string_t& overall_status_message, nc_link_status::status link_status, const utility::string_t& link_status_message, nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_synchronization_status::status synchronization_status, const utility::string_t& synchronization_status_message, const utility::string_t& synchronization_source_id, nc_stream_status::status stream_status, const utility::string_t& stream_status_message)
755755
{
756756
using web::json::value;
757757

@@ -763,7 +763,7 @@ namespace nmos
763763
data[nmos::fields::nc::connection_status_message] = value::string(connection_status_message);
764764
data[nmos::fields::nc::synchronization_status] = value::number(synchronization_status);
765765
data[nmos::fields::nc::synchronization_status_message] = value::string(synchronization_status_message);
766-
data[nmos::fields::nc::grand_master_clock_id] = value::string(grand_master_clock_id);
766+
data[nmos::fields::nc::synchronization_source_id] = value::string(synchronization_source_id);
767767
data[nmos::fields::nc::stream_status] = value::number(stream_status);
768768
data[nmos::fields::nc::stream_status_message] = value::string(stream_status_message);
769769

@@ -1208,7 +1208,7 @@ namespace nmos
12081208
web::json::push_back(properties, details::make_nc_property_descriptor(U("Connection status message property"), nc_receiver_monitor_connection_status_message_property_id, nmos::fields::nc::connection_status_message, U("NcString"), true, true, false, false, value::null()));
12091209
web::json::push_back(properties, details::make_nc_property_descriptor(U("Synchronization status property"), nc_receiver_monitor_synchronization_status_property_id, nmos::fields::nc::synchronization_status, U("NcSynchronizationStatus"), true, false, false, false, value::null()));
12101210
web::json::push_back(properties, details::make_nc_property_descriptor(U("Synchronization status message property"), nc_receiver_monitor_synchronization_status_message_property_id, nmos::fields::nc::synchronization_status_message, U("NcString"), true, true, false, false, value::null()));
1211-
web::json::push_back(properties, details::make_nc_property_descriptor(U("Grand master clock id property"), nc_receiver_monitor_synchronization_grand_master_clock_id_property_id, nmos::fields::nc::grand_master_clock_id, U("NcString"), true, true, false, false, value::null()));
1211+
web::json::push_back(properties, details::make_nc_property_descriptor(U("Grand master clock id property"), nc_receiver_monitor_synchronization_synchronization_source_id_property_id, nmos::fields::nc::synchronization_source_id, U("NcString"), true, true, false, false, value::null()));
12121212
web::json::push_back(properties, details::make_nc_property_descriptor(U("Stream status property"), nc_receiver_monitor_stream_status_property_id, nmos::fields::nc::stream_status, U("NcStreamStatus"), true, false, false, false, value::null()));
12131213
web::json::push_back(properties, details::make_nc_property_descriptor(U("Stream status message property"), nc_receiver_monitor_stream_status_message_property_id, nmos::fields::nc::stream_status_message, U("NcString"), true, true, false, false, value::null()));
12141214

@@ -1219,8 +1219,8 @@ namespace nmos
12191219
using web::json::value;
12201220

12211221
auto methods = value::array();
1222-
web::json::push_back(methods, details::make_nc_method_descriptor(U("Gets the lost packets"), nc_receiver_monitor_get_lost_packets_method_id, U("GetLostPackets"), U("NcMethodResultCounter"), value::array(), false));
1223-
web::json::push_back(methods, details::make_nc_method_descriptor(U("Gets the late packets"), nc_receiver_monitor_get_late_packets_method_id, U("GetLatePackets"), U("NcMethodResultCounter"), value::array(), false));
1222+
web::json::push_back(methods, details::make_nc_method_descriptor(U("Gets the lost packet counters"), nc_receiver_monitor_get_lost_packet_counters_method_id, U("GetLostPacketCounters"), U("NcMethodResultCounters"), value::array(), false));
1223+
web::json::push_back(methods, details::make_nc_method_descriptor(U("Gets the late packet counters"), nc_receiver_monitor_get_late_packet_counters_method_id, U("GetLatePacketCounters"), U("NcMethodResultCounters"), value::array(), false));
12241224
web::json::push_back(methods, details::make_nc_method_descriptor(U("Resets the packet counters"), nc_receiver_monitor_reset_packet_counters_method_id, U("ResetPacketCounters"), U("NcMethodResult"), value::array(), false));
12251225

12261226
return methods;
@@ -2073,6 +2073,7 @@ namespace nmos
20732073
using web::json::value;
20742074

20752075
auto items = value::array();
2076+
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Inactive"), U("Inactive"), 0));
20762077
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("The overall status is healthy"), U("Healthy"), 1));
20772078
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("The overall status is partially healthy"), U("PartiallyHealthy"), 2));
20782079
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("The overall status is unhealthy"), U("Unhealthy"), 3));
@@ -2115,13 +2116,23 @@ namespace nmos
21152116
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and unhealthy"), U("Unhealthy"), 3));
21162117
return details::make_nc_datatype_descriptor_enum(U("Stream status enum data type"), U("NcStreamStatus"), items, value::null());
21172118
}
2118-
// TOO: link
2119-
web::json::value make_nc_method_result_counter_datatype()
2119+
// TODO: link
2120+
web::json::value make_nc_packet_counter_datatype()
21202121
{
21212122
using web::json::value;
21222123

21232124
auto fields = value::array();
2125+
web::json::push_back(fields, details::make_nc_field_descriptor(U("Counter name"), nmos::fields::nc::name, U("NcString"), false, false, value::null()));
21242126
web::json::push_back(fields, details::make_nc_field_descriptor(U("Counter value"), nmos::fields::nc::value, U("NcUint64"), false, false, value::null()));
2125-
return details::make_nc_datatype_descriptor_struct(U("Counter method result"), U("NcMethodResultCounter"), fields, U("NcMethodResult"), value::null());
2127+
return details::make_nc_datatype_descriptor_struct(U("Packet counter data type"), U("NcPacketCounter"), fields, value::null());
2128+
}
2129+
// TOO: link
2130+
web::json::value make_nc_method_result_counters_datatype()
2131+
{
2132+
using web::json::value;
2133+
2134+
auto fields = value::array();
2135+
web::json::push_back(fields, details::make_nc_field_descriptor(U("Counters"), nmos::fields::nc::value, U("NcPacketCounter"), false, true, value::null()));
2136+
return details::make_nc_datatype_descriptor_struct(U("Counter method result"), U("NcMethodResultCounters"), fields, U("NcMethodResult"), value::null());
21262137
}
21272138
}

Development/nmos/control_protocol_resource.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ namespace nmos
180180
// TODO: add link
181181
web::json::value make_nc_status_monitor(const nc_class_id& class_id, nc_oid oid, bool constant_oid, nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints, bool enabled, nc_overall_status::status overall_status, const utility::string_t& overall_status_message);
182182
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor
183-
web::json::value make_receiver_monitor(const nc_class_id& class_id, nc_oid oid, bool constant_oid, nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints, bool enabled, nc_overall_status::status overall_status, const utility::string_t& overall_status_message, nc_link_status::status link_status, const utility::string_t& link_status_message, nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_synchronization_status::status synchronization_status, const utility::string_t& synchronization_status_message, const utility::string_t& grand_master_clock_id, nc_stream_status::status stream_status, const utility::string_t& stream_status_message);
183+
web::json::value make_receiver_monitor(const nc_class_id& class_id, nc_oid oid, bool constant_oid, nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints, bool enabled, nc_overall_status::status overall_status, const utility::string_t& overall_status_message, nc_link_status::status link_status, const utility::string_t& link_status_message, nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_synchronization_status::status synchronization_status, const utility::string_t& synchronization_status_message, const utility::string_t& synchronization_source_id, nc_stream_status::status stream_status, const utility::string_t& stream_status_message);
184184

185185
// See https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/Framework.html#ncmanager
186186
web::json::value make_nc_manager(const nc_class_id& class_id, nc_oid oid, bool constant_oid, const web::json::value& owner, const utility::string_t& role, const web::json::value& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints);
@@ -425,16 +425,18 @@ namespace nmos
425425
//
426426
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncconnectionstatus
427427
web::json::value make_nc_connection_status_datatype();
428-
// TOO: link
428+
// TODO: link
429429
web::json::value make_nc_overall_status_datatype();
430-
// TOO: link
430+
// TODO: link
431431
web::json::value make_nc_link_status_datatype();
432-
// TOO: link
432+
// TODO: link
433433
web::json::value make_nc_synchronization_status_datatype();
434-
// TOO: link
434+
// TODO: link
435435
web::json::value make_nc_stream_status_datatype();
436-
// TOO: link
437-
web::json::value make_nc_method_result_counter_datatype();
436+
// TODO: link
437+
web::json::value make_nc_packet_counter_datatype();
438+
// TODO: link
439+
web::json::value make_nc_method_result_counters_datatype();
438440
}
439441

440442
#endif

Development/nmos/control_protocol_resources.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ namespace nmos
6767
//
6868
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor
6969
control_protocol_resource make_receiver_monitor(nc_oid oid, bool constant_oid, nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints, bool enabled,
70-
nc_overall_status::status overall_status, const utility::string_t& overall_status_message, nc_link_status::status link_status, const utility::string_t& link_status_message, nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_synchronization_status::status synchronization_status, const utility::string_t& synchronization_status_message, const utility::string_t& grand_master_clock_id, nc_stream_status::status stream_status, const utility::string_t& stream_status_message)
70+
nc_overall_status::status overall_status, const utility::string_t& overall_status_message, nc_link_status::status link_status, const utility::string_t& link_status_message, nc_connection_status::status connection_status, const utility::string_t& connection_status_message, nc_synchronization_status::status synchronization_status, const utility::string_t& synchronization_status_message, const utility::string_t& synchronization_source_id, nc_stream_status::status stream_status, const utility::string_t& stream_status_message)
7171
{
72-
auto data = details::make_receiver_monitor(nc_receiver_monitor_class_id, oid, constant_oid, owner, role, user_label, description, touchpoints, runtime_property_constraints, enabled, overall_status, overall_status_message, link_status, link_status_message, connection_status, connection_status_message, synchronization_status, synchronization_status_message, grand_master_clock_id, stream_status, stream_status_message);
72+
auto data = details::make_receiver_monitor(nc_receiver_monitor_class_id, oid, constant_oid, owner, role, user_label, description, touchpoints, runtime_property_constraints, enabled, overall_status, overall_status_message, link_status, link_status_message, connection_status, connection_status_message, synchronization_status, synchronization_status_message, synchronization_source_id, stream_status, stream_status_message);
7373

7474
return{ is12_versions::v1_0, types::nc_receiver_monitor, std::move(data), true };
7575
}

Development/nmos/control_protocol_resources.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace nmos
3737
const utility::string_t& connection_status_message = U(""),
3838
nc_synchronization_status::status synchronization_status = nc_synchronization_status::not_used,
3939
const utility::string_t& synchronization_status_message = U(""),
40-
const utility::string_t& grand_master_clock_id = U(""),
40+
const utility::string_t& synchronization_source_id = U(""),
4141
nc_stream_status::status stream_status = nc_stream_status::inactive,
4242
const utility::string_t& stream_status_message = U("")
4343
);

Development/nmos/control_protocol_typedefs.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ namespace nmos
212212
const nc_method_id nc_class_manager_get_datatype_method_id(3, 2);
213213
// NcMethodIds for NcReceiverMonitor
214214
// TODO: link
215-
const nc_method_id nc_receiver_monitor_get_lost_packets_method_id(4, 1);
216-
const nc_method_id nc_receiver_monitor_get_late_packets_method_id(4, 2);
215+
const nc_method_id nc_receiver_monitor_get_lost_packet_counters_method_id(4, 1);
216+
const nc_method_id nc_receiver_monitor_get_late_packet_counters_method_id(4, 2);
217217
const nc_method_id nc_receiver_monitor_reset_packet_counters_method_id(4, 3);
218218

219219
// NcPropertyId
@@ -263,7 +263,7 @@ namespace nmos
263263
const nc_property_id nc_receiver_monitor_connection_status_message_property_id(4, 4);
264264
const nc_property_id nc_receiver_monitor_synchronization_status_property_id(4, 5);
265265
const nc_property_id nc_receiver_monitor_synchronization_status_message_property_id(4, 6);
266-
const nc_property_id nc_receiver_monitor_synchronization_grand_master_clock_id_property_id(4, 7);
266+
const nc_property_id nc_receiver_monitor_synchronization_synchronization_source_id_property_id(4, 7);
267267
const nc_property_id nc_receiver_monitor_stream_status_property_id(4, 8);
268268
const nc_property_id nc_receiver_monitor_stream_status_message_property_id(4, 9);
269269
const nc_property_id nc_receiver_monitor_protected_signal_protection_status_property_id(4, 1);

Development/nmos/json_fields.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ namespace nmos
336336
const web::json::field_as_string link_status_message{ U("linkStatusMessage") };
337337
const web::json::field_as_integer synchronization_status{ U("synchronizationStatus") }; // NcSynchronizationStatus
338338
const web::json::field_as_string synchronization_status_message{ U("synchronizationStatusMessage") };
339-
const web::json::field_as_string grand_master_clock_id{ U("grandMasterClockId") };
339+
const web::json::field_as_string synchronization_source_id{ U("synchronizationSourceId") };
340340
const web::json::field_as_bool signal_protection_status{ U("signalProtectionStatus") };
341341
const web::json::field_as_integer stream_status{ U("streamStatus") }; // NcStreamStatus
342342
const web::json::field_as_string stream_status_message{ U("streamStatusMessage") };

0 commit comments

Comments
 (0)