diff --git a/Development/nmos/control_protocol_resource.cpp b/Development/nmos/control_protocol_resource.cpp index e73a092e..2578f1fb 100644 --- a/Development/nmos/control_protocol_resource.cpp +++ b/Development/nmos/control_protocol_resource.cpp @@ -751,7 +751,7 @@ namespace nmos } // See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor - 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) + 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) { using web::json::value; @@ -763,7 +763,7 @@ namespace nmos data[nmos::fields::nc::connection_status_message] = value::string(connection_status_message); data[nmos::fields::nc::synchronization_status] = value::number(synchronization_status); data[nmos::fields::nc::synchronization_status_message] = value::string(synchronization_status_message); - data[nmos::fields::nc::grand_master_clock_id] = value::string(grand_master_clock_id); + data[nmos::fields::nc::synchronization_source_id] = value::string(synchronization_source_id); data[nmos::fields::nc::stream_status] = value::number(stream_status); data[nmos::fields::nc::stream_status_message] = value::string(stream_status_message); @@ -1208,7 +1208,7 @@ namespace nmos 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())); 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())); 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())); - 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())); + 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())); 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())); 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())); @@ -1219,8 +1219,8 @@ namespace nmos using web::json::value; auto methods = value::array(); - 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)); - 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)); + 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)); + 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)); 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)); return methods; @@ -2073,6 +2073,7 @@ namespace nmos using web::json::value; auto items = value::array(); + web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Inactive"), U("Inactive"), 0)); web::json::push_back(items, details::make_nc_enum_item_descriptor(U("The overall status is healthy"), U("Healthy"), 1)); web::json::push_back(items, details::make_nc_enum_item_descriptor(U("The overall status is partially healthy"), U("PartiallyHealthy"), 2)); 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 web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and unhealthy"), U("Unhealthy"), 3)); return details::make_nc_datatype_descriptor_enum(U("Stream status enum data type"), U("NcStreamStatus"), items, value::null()); } - // TOO: link - web::json::value make_nc_method_result_counter_datatype() + // TODO: link + web::json::value make_nc_packet_counter_datatype() { using web::json::value; auto fields = value::array(); + web::json::push_back(fields, details::make_nc_field_descriptor(U("Counter name"), nmos::fields::nc::name, U("NcString"), false, false, value::null())); web::json::push_back(fields, details::make_nc_field_descriptor(U("Counter value"), nmos::fields::nc::value, U("NcUint64"), false, false, value::null())); - return details::make_nc_datatype_descriptor_struct(U("Counter method result"), U("NcMethodResultCounter"), fields, U("NcMethodResult"), value::null()); + return details::make_nc_datatype_descriptor_struct(U("Packet counter data type"), U("NcPacketCounter"), fields, value::null()); + } + // TOO: link + web::json::value make_nc_method_result_counters_datatype() + { + using web::json::value; + + auto fields = value::array(); + web::json::push_back(fields, details::make_nc_field_descriptor(U("Counters"), nmos::fields::nc::value, U("NcPacketCounter"), false, true, value::null())); + return details::make_nc_datatype_descriptor_struct(U("Counter method result"), U("NcMethodResultCounters"), fields, U("NcMethodResult"), value::null()); } } diff --git a/Development/nmos/control_protocol_resource.h b/Development/nmos/control_protocol_resource.h index 28b08b7d..4c34590a 100644 --- a/Development/nmos/control_protocol_resource.h +++ b/Development/nmos/control_protocol_resource.h @@ -180,7 +180,7 @@ namespace nmos // TODO: add link 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); // See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor - 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); + 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); // See https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/Framework.html#ncmanager 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 // // See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncconnectionstatus web::json::value make_nc_connection_status_datatype(); - // TOO: link + // TODO: link web::json::value make_nc_overall_status_datatype(); - // TOO: link + // TODO: link web::json::value make_nc_link_status_datatype(); - // TOO: link + // TODO: link web::json::value make_nc_synchronization_status_datatype(); - // TOO: link + // TODO: link web::json::value make_nc_stream_status_datatype(); - // TOO: link - web::json::value make_nc_method_result_counter_datatype(); + // TODO: link + web::json::value make_nc_packet_counter_datatype(); + // TODO: link + web::json::value make_nc_method_result_counters_datatype(); } #endif diff --git a/Development/nmos/control_protocol_resources.cpp b/Development/nmos/control_protocol_resources.cpp index ff409282..a0247e22 100644 --- a/Development/nmos/control_protocol_resources.cpp +++ b/Development/nmos/control_protocol_resources.cpp @@ -67,9 +67,9 @@ namespace nmos // // See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor 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, - 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) + 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) { - 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); + 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); return{ is12_versions::v1_0, types::nc_receiver_monitor, std::move(data), true }; } diff --git a/Development/nmos/control_protocol_resources.h b/Development/nmos/control_protocol_resources.h index 8cd03605..71fd66cf 100644 --- a/Development/nmos/control_protocol_resources.h +++ b/Development/nmos/control_protocol_resources.h @@ -37,7 +37,7 @@ namespace nmos const utility::string_t& connection_status_message = U(""), nc_synchronization_status::status synchronization_status = nc_synchronization_status::not_used, const utility::string_t& synchronization_status_message = U(""), - const utility::string_t& grand_master_clock_id = U(""), + const utility::string_t& synchronization_source_id = U(""), nc_stream_status::status stream_status = nc_stream_status::inactive, const utility::string_t& stream_status_message = U("") ); diff --git a/Development/nmos/control_protocol_typedefs.h b/Development/nmos/control_protocol_typedefs.h index e8e79347..8d0a724c 100644 --- a/Development/nmos/control_protocol_typedefs.h +++ b/Development/nmos/control_protocol_typedefs.h @@ -212,8 +212,8 @@ namespace nmos const nc_method_id nc_class_manager_get_datatype_method_id(3, 2); // NcMethodIds for NcReceiverMonitor // TODO: link - const nc_method_id nc_receiver_monitor_get_lost_packets_method_id(4, 1); - const nc_method_id nc_receiver_monitor_get_late_packets_method_id(4, 2); + const nc_method_id nc_receiver_monitor_get_lost_packet_counters_method_id(4, 1); + const nc_method_id nc_receiver_monitor_get_late_packet_counters_method_id(4, 2); const nc_method_id nc_receiver_monitor_reset_packet_counters_method_id(4, 3); // NcPropertyId @@ -263,7 +263,7 @@ namespace nmos const nc_property_id nc_receiver_monitor_connection_status_message_property_id(4, 4); const nc_property_id nc_receiver_monitor_synchronization_status_property_id(4, 5); const nc_property_id nc_receiver_monitor_synchronization_status_message_property_id(4, 6); - const nc_property_id nc_receiver_monitor_synchronization_grand_master_clock_id_property_id(4, 7); + const nc_property_id nc_receiver_monitor_synchronization_synchronization_source_id_property_id(4, 7); const nc_property_id nc_receiver_monitor_stream_status_property_id(4, 8); const nc_property_id nc_receiver_monitor_stream_status_message_property_id(4, 9); const nc_property_id nc_receiver_monitor_protected_signal_protection_status_property_id(4, 1); diff --git a/Development/nmos/json_fields.h b/Development/nmos/json_fields.h index 075da370..db30150d 100644 --- a/Development/nmos/json_fields.h +++ b/Development/nmos/json_fields.h @@ -336,7 +336,7 @@ namespace nmos const web::json::field_as_string link_status_message{ U("linkStatusMessage") }; const web::json::field_as_integer synchronization_status{ U("synchronizationStatus") }; // NcSynchronizationStatus const web::json::field_as_string synchronization_status_message{ U("synchronizationStatusMessage") }; - const web::json::field_as_string grand_master_clock_id{ U("grandMasterClockId") }; + const web::json::field_as_string synchronization_source_id{ U("synchronizationSourceId") }; const web::json::field_as_bool signal_protection_status{ U("signalProtectionStatus") }; const web::json::field_as_integer stream_status{ U("streamStatus") }; // NcStreamStatus const web::json::field_as_string stream_status_message{ U("streamStatusMessage") };