Skip to content

Commit 1a4dbc7

Browse files
Merge branch 'master' into bcp-008-01
# Conflicts: # Development/nmos/api_utils.cpp # Development/nmos/control_protocol_handlers.cpp # Development/nmos/control_protocol_resource.cpp # Development/nmos/control_protocol_resource.h # Development/nmos/control_protocol_resources.h # Development/nmos/control_protocol_state.cpp # Development/nmos/control_protocol_typedefs.h
2 parents abf727a + 11db167 commit 1a4dbc7

20 files changed

+957
-283
lines changed

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
- name: install conan
9999
if: matrix.use_conan == true
100100
run: |
101-
pip install conan~=2.4.1
101+
pip install conan~=2.19.1
102102
103103
- name: 'ubuntu-14.04: install cmake'
104104
if: matrix.os == 'ubuntu-14.04'

.github/workflows/src/build-setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- name: install conan
22
if: matrix.use_conan == true
33
run: |
4-
pip install conan~=2.4.1
4+
pip install conan~=2.19.1
55
66
- name: 'ubuntu-14.04: install cmake'
77
if: matrix.os == 'ubuntu-14.04'

Development/conanfile.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
boost/1.83.0
33
cpprestsdk/2.10.19
44
websocketpp/0.8.2
5-
openssl/3.2.1
5+
openssl/3.5.2
66
json-schema-validator/2.3.0
77
nlohmann_json/3.11.3
8-
zlib/1.2.13
9-
jwt-cpp/0.7.0
8+
zlib/1.3.1
9+
jwt-cpp/0.7.1
1010

1111
[imports]
1212
bin, *.dll -> ./bin

Development/nmos/api_utils.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ namespace nmos
168168
{ U("nc_manager"), nmos::types::nc_manager },
169169
{ U("nc_device_manager"), nmos::types::nc_device_manager },
170170
{ U("nc_class_manager"), nmos::types::nc_class_manager },
171-
{ U("nc_status_monitor"), nmos::types::nc_status_monitor },
172-
{ U("nc_receiver_monitor"), nmos::types::nc_receiver_monitor },
171+
{ U("nc_status_monitor"), nmos::types::nc_status_monitor }, // this is commonly used for nc_receiver_monitor and nc_sender_monitor
173172
{ U("nc_ident_beacon"), nmos::types::nc_ident_beacon }
174173
};
175174
return types_from_resourceType.at(resourceType);
@@ -195,8 +194,7 @@ namespace nmos
195194
{ nmos::types::nc_manager, U("nc_manager") },
196195
{ nmos::types::nc_device_manager, U("nc_device_manager") },
197196
{ nmos::types::nc_class_manager, U("nc_class_manager") },
198-
{ nmos::types::nc_status_monitor, U("nc_status_monitor") },
199-
{ nmos::types::nc_receiver_monitor, U("nc_receiver_monitor") },
197+
{ nmos::types::nc_status_monitor, U("nc_status_monitor") }, // this is commonly used for nc_receiver_monitor and nc_sender_monitor
200198
{ nmos::types::nc_ident_beacon, U("nc_ident_beacon") }
201199
};
202200
return resourceTypes_from_type.at(type);
@@ -701,7 +699,15 @@ namespace nmos
701699
add_api_finally_handler(api_, hsts, gate);
702700
auto api = [api_, &gate](web::http::http_request req) mutable
703701
{
702+
// hmm, in Windows, the boost version of the time_point::now sometimes returns the same value after a small time increment.
703+
// This issue does not seem to happen in the std::chrono implementation.
704+
#if defined(_WIN32) && defined (BST_THREAD_BOOST)
705+
// calculate received_time using std::chrono
706+
const auto now = tai_clock::time_point(tai_clock::duration(std::chrono::system_clock::now().time_since_epoch().count() + tai_clock::tai_offset().count()));
707+
req.headers().add(details::received_time, nmos::make_version(tai_from_time_point(now)));
708+
#else
704709
req.headers().add(details::received_time, nmos::make_version());
710+
#endif
705711
slog::log<slog::severities::too_much_info>(gate, SLOG_FLF)
706712
<< stash_remote_address(req.remote_address())
707713
<< stash_http_method(req.method())

Development/nmos/control_protocol_resource.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ namespace nmos
738738
return data;
739739
}
740740

741-
// TODO: add link
741+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncstatusmonitor
742742
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, uint64_t status_reporting_delay)
743743
{
744744
using web::json::value;
@@ -791,7 +791,7 @@ namespace nmos
791791
return data;
792792
}
793793

794-
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor
794+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncsendermonitor
795795
web::json::value make_sender_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_transmission_status::status transmission_status, const utility::string_t& transmission_status_message, nc_synchronization_status::status external_synchronization_status, const utility::string_t& external_synchronization_status_message, const web::json::value& synchronization_source_id, nc_essence_status::status essence_status, const utility::string_t& essence_status_message, uint32_t status_reporting_delay, bool auto_reset_monitor)
796796
{
797797
using web::json::value;
@@ -1233,7 +1233,7 @@ namespace nmos
12331233
return value::array();
12341234
}
12351235

1236-
// TODO: add link
1236+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncstatusmonitor
12371237
web::json::value make_nc_status_monitor_properties()
12381238
{
12391239
using web::json::value;
@@ -1420,7 +1420,7 @@ namespace nmos
14201420
}
14211421

14221422
// Monitoring feature set control classes
1423-
// TODO: link
1423+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncstatusmonitor
14241424
web::json::value make_nc_status_monitor_class()
14251425
{
14261426
using web::json::value;
@@ -2169,8 +2169,7 @@ namespace nmos
21692169

21702170
// Monitoring datatype defintions
21712171
//
2172-
2173-
// TODO: link
2172+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncconnectionstatus
21742173
web::json::value make_nc_connection_status_datatype()
21752174
{
21762175
using web::json::value;
@@ -2180,9 +2179,9 @@ namespace nmos
21802179
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and healthy"), U("Healthy"), nc_connection_status::status::healthy));
21812180
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and partially healthy"), U("PartiallyHealthy"), nc_connection_status::status::partially_healthy));
21822181
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and unhealthy"), U("Unhealthy"), nc_connection_status::status::unhealthy));
2183-
return details::make_nc_datatype_descriptor_enum(U("Connection status enum data typee"), U("NcConnectionStatus"), items, value::null());
2182+
return details::make_nc_datatype_descriptor_enum(U("Connection status enum data type"), U("NcConnectionStatus"), items, value::null());
21842183
}
2185-
// TODO: link
2184+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#nccounter
21862185
web::json::value make_nc_counter_datatype()
21872186
{
21882187
using web::json::value;
@@ -2193,7 +2192,7 @@ namespace nmos
21932192
web::json::push_back(fields, details::make_nc_field_descriptor(U("Description"), nmos::fields::nc::description, U("NcString"), true, false, value::null()));
21942193
return details::make_nc_datatype_descriptor_struct(U("Counter data type"), U("NcCounter"), fields, value::null());
21952194
}
2196-
// TOO: link
2195+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncessencestatus
21972196
web::json::value make_nc_essence_status_datatype()
21982197
{
21992198
using web::json::value;
@@ -2205,7 +2204,7 @@ namespace nmos
22052204
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and unhealthy"), U("Unhealthy"), nc_essence_status::status::unhealthy));
22062205
return details::make_nc_datatype_descriptor_enum(U("Essence status enum data type"), U("NcEssenceStatus"), items, value::null());
22072206
}
2208-
// TODO: link
2207+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#nclinkstatus
22092208
web::json::value make_nc_link_status_datatype()
22102209
{
22112210
using web::json::value;
@@ -2216,7 +2215,7 @@ namespace nmos
22162215
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("All the associated network interfaces are down"), U("AllDown"), nc_link_status::status::all_down));
22172216
return details::make_nc_datatype_descriptor_enum(U("Link status enum data type"), U("NcLinkStatus"), items, value::null());
22182217
}
2219-
// TODO: link
2218+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncoverallstatus
22202219
web::json::value make_nc_overall_status_datatype()
22212220
{
22222221
using web::json::value;
@@ -2228,7 +2227,7 @@ namespace nmos
22282227
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("The overall status is unhealthy"), U("Unhealthy"), nc_overall_status::status::unhealthy));
22292228
return details::make_nc_datatype_descriptor_enum(U("Overall status enum data type"), U("NcOverallStatus"), items, value::null());
22302229
}
2231-
// TODO: link
2230+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncsynchronizationstatus
22322231
web::json::value make_nc_synchronization_status_datatype()
22332232
{
22342233
using web::json::value;
@@ -2240,7 +2239,7 @@ namespace nmos
22402239
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Not locked to a synchronization source"), U("Unhealthy"), nc_synchronization_status::status::unhealthy));
22412240
return details::make_nc_datatype_descriptor_enum(U("Synchronization status enum data type"), U("NcSynchronizationStatus"), items, value::null());
22422241
}
2243-
// TODO: link
2242+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncstreamstatus
22442243
web::json::value make_nc_stream_status_datatype()
22452244
{
22462245
using web::json::value;
@@ -2252,7 +2251,7 @@ namespace nmos
22522251
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and unhealthy"), U("Unhealthy"), nc_stream_status::status::unhealthy));
22532252
return details::make_nc_datatype_descriptor_enum(U("Stream status enum data type"), U("NcStreamStatus"), items, value::null());
22542253
}
2255-
// TODO: link
2254+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#nctransmissionstatus
22562255
web::json::value make_nc_transmission_status_datatype()
22572256
{
22582257
using web::json::value;
@@ -2264,7 +2263,7 @@ namespace nmos
22642263
web::json::push_back(items, details::make_nc_enum_item_descriptor(U("Active and unhealthy"), U("Unhealthy"), nc_transmission_status::status::unhealthy));
22652264
return details::make_nc_datatype_descriptor_enum(U("Transmission status enum data type"), U("NcTransmissionStatus"), items, value::null());
22662265
}
2267-
// TOO: link
2266+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncmethodresultcounters
22682267
web::json::value make_nc_method_result_counters_datatype()
22692268
{
22702269
using web::json::value;

Development/nmos/control_protocol_resource.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ namespace nmos
179179

180180
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncstatusmonitor
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, uint64_t status_reporting_delay);
182+
182183
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncreceivermonitor
183184
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 external_synchronization_status, const utility::string_t& external_synchronization_status_message, const web::json::value& synchronization_source_id, nc_stream_status::status stream_status, const utility::string_t& stream_status_message, uint32_t status_reporting_delay, bool auto_reset_monitor);
185+
184186
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncsendermonitor
185187
web::json::value make_sender_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_transmission_status::status transmission_status, const utility::string_t& transmission_status_message, nc_synchronization_status::status external_synchronization_status, const utility::string_t& external_synchronization_status_message, const web::json::value& synchronization_source_id, nc_essence_status::status essence_status, const utility::string_t& essence_status_message, uint32_t status_reporting_delay, bool auto_reset_monitor);
186188

@@ -242,7 +244,7 @@ namespace nmos
242244
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncsendermonitor
243245
web::json::value make_nc_sender_monitor_class();
244246

245-
// control classes proprties/methods/events
247+
// control classes properties/methods/events
246248
// See https://specs.amwa.tv/ms-05-02/branches/v1.0.x/docs/Framework.html#ncobject
247249
web::json::value make_nc_object_properties();
248250
web::json::value make_nc_object_methods();
@@ -267,9 +269,8 @@ namespace nmos
267269
web::json::value make_nc_class_manager_properties();
268270
web::json::value make_nc_class_manager_methods();
269271
web::json::value make_nc_class_manager_events();
270-
271272
// Monitoring feature set control classes
272-
// TODO: link
273+
// https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncstatusmonitor
273274
web::json::value make_nc_status_monitor_properties();
274275
web::json::value make_nc_status_monitor_methods();
275276
web::json::value make_nc_status_monitor_events();
@@ -433,21 +434,21 @@ namespace nmos
433434
//
434435
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncconnectionstatus
435436
web::json::value make_nc_connection_status_datatype();
436-
// TODO: link
437+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncessencestatus
437438
web::json::value make_nc_essence_status_datatype();
438-
// TODO: link
439+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncoverallstatus
439440
web::json::value make_nc_overall_status_datatype();
440-
// TODO: link
441+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#nclinkstatus
441442
web::json::value make_nc_link_status_datatype();
442-
// TODO: link
443+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncsynchronizationstatus
443444
web::json::value make_nc_synchronization_status_datatype();
444-
// TODO: link
445+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncstreamstatus
445446
web::json::value make_nc_stream_status_datatype();
446-
// TODO: link
447+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#nccounter
447448
web::json::value make_nc_counter_datatype();
448-
// TODO: link
449+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#nctransmissionstatus
449450
web::json::value make_nc_transmission_status_datatype();
450-
// TODO: link
451+
// See https://specs.amwa.tv/nmos-control-feature-sets/branches/main/monitoring/#ncmethodresultcounters
451452
web::json::value make_nc_method_result_counters_datatype();
452453
}
453454

Development/nmos/control_protocol_resources.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace nmos
4343
uint32_t status_reporting_delay = 3,
4444
bool auto_reset_monitor = true
4545
);
46-
46+
//
4747
// create Sender Monitor resource
4848
control_protocol_resource make_sender_monitor(nc_oid oid, bool constant_oid, nmos::nc_oid owner, const utility::string_t& role, const utility::string_t& user_label, const utility::string_t& description, const web::json::value& touchpoints = web::json::value::null(), const web::json::value& runtime_property_constraints = web::json::value::null(), bool enabled = true,
4949
nc_overall_status::status overall_status = nc_overall_status::status::inactive,

0 commit comments

Comments
 (0)