Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IS-14 support #387

Draft
wants to merge 153 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
71f13f0
Create IS-12 websocket server
lo-simon May 9, 2023
c3d3637
Remove incorrect comment
lo-simon May 10, 2023
4728d7c
Add `control_protocol_ws_port` to node example config
lo-simon May 10, 2023
7de45f3
Merge branch 'sony:is-12' into is-12
lo-simon May 15, 2023
549dd0e
Use lock to protect websockets
lo-simon May 15, 2023
599a5f5
Fix to obtain the event_ws position from the ws_handlers
lo-simon May 15, 2023
fae85fb
Create Root block, Device manager and Class manager nmos resources
lo-simon Aug 3, 2023
f42bb05
Merge remote-tracking branch 'origin/master' into is-12
lo-simon Aug 3, 2023
bb6db52
Add readonly on Get propertry support.
lo-simon Aug 8, 2023
eb71ebd
Fix declaration of nmos::experimental::control_classes for Linux
lo-simon Aug 8, 2023
212bdf4
Move functions around
lo-simon Aug 8, 2023
bb87347
Update IS-12 schemas
lo-simon Aug 8, 2023
2aba14a
Tidy up make_nc_class_manager
lo-simon Aug 8, 2023
71f97b5
Add NcObject's GetSequenceItem
lo-simon Aug 8, 2023
6e1640f
Fix GetSequenceItem and add GetSequenceLength
lo-simon Aug 8, 2023
a4455bc
Code tidy up
lo-simon Aug 9, 2023
bbf2604
Add SetSequenceItem, AddSequenceItem, RemoveSequenceItem, FindMembers…
lo-simon Aug 9, 2023
b5cbfc7
Fix AddSequenceItem
lo-simon Aug 9, 2023
4eab0e0
Fix FindMembersByPath
lo-simon Aug 10, 2023
5eeaa3b
Add FindMembersByRole and FindMembersByClassId
lo-simon Aug 11, 2023
5d5e2b8
Add GetControlClass, and GetDataType
lo-simon Aug 15, 2023
6eddf4e
Bump up ubuntu 14.04 to use python 3.7 to overcome
lo-simon Aug 16, 2023
fa17cd1
Fix ModuleNotFoundError: No module named '_ctypes'
lo-simon Aug 16, 2023
a356f3e
Fixing python3.7 install
lo-simon Aug 16, 2023
15a4e19
Bump up to python3.8
lo-simon Aug 16, 2023
70155a4
Add NcIdentBeacon, NcReceiverMonitor and NcReceiverMonitorProtected
lo-simon Aug 18, 2023
f7dacb2
Use control_protocol_ws_port to construct request URLs for the Contro…
lo-simon Aug 18, 2023
52dc55a
Remove unused code
lo-simon Aug 19, 2023
3924c6b
Fix find_members_by_path and write log on method
lo-simon Aug 22, 2023
9145752
Remove un-used code
lo-simon Aug 22, 2023
0ef34d0
Add Log gate to method
lo-simon Aug 22, 2023
dba1042
Move nc_class_id definition from control_protocol_resource to control…
lo-simon Aug 22, 2023
38077d2
Add nested block examples
lo-simon Aug 22, 2023
90a768b
Extract IS-12 version from the rx ws path
lo-simon Aug 23, 2023
d47b47a
Add helper functions to create non-standard control class, and genera…
lo-simon Aug 24, 2023
901780a
Use of nc_class_id struct and method_id struct for map key
lo-simon Aug 29, 2023
40c3dc1
Remove un-used code
lo-simon Aug 30, 2023
e4e54d6
Add support for allowing user to insert non-standard control class me…
lo-simon Aug 31, 2023
c581781
Fix 'nmos::experimental::control_class' constructor initialization
lo-simon Aug 31, 2023
3b58506
Fix indentation
lo-simon Sep 7, 2023
279358c
Use better error instead of `out of bounds`
lo-simon Sep 7, 2023
431b4a8
Add non-standard Example class based on nmos-device-control-mock
lo-simon Sep 12, 2023
0b87a78
Update log messages
lo-simon Sep 12, 2023
d8a803f
Fix is_nc_block()
lo-simon Sep 12, 2023
9e1fdc8
Tidy-up function signatures
lo-simon Sep 12, 2023
8b4d0d1
Add subscription support
lo-simon Sep 15, 2023
b7a24e5
Update outdated IS-12 links
lo-simon Sep 15, 2023
ec51638
Tidy up, less casting
lo-simon Sep 18, 2023
de5beed
Add description to nc_object to simplify create nc_xxx class
lo-simon Sep 19, 2023
fa2a4ba
Move nc helper functions to nc utils
lo-simon Sep 19, 2023
ac8f21b
look before accessing control_protocol_state
lo-simon Sep 19, 2023
a805d8a
pusback allows on NcBlock only
lo-simon Sep 19, 2023
4873c40
Add control protocol unit tests
lo-simon Sep 19, 2023
68defeb
Add more unit tests
lo-simon Sep 20, 2023
f773372
Add NcPropertyConstraintsNumber, NcPropertyConstraintsString, NcParam…
lo-simon Sep 21, 2023
1bd7283
Tidy up make_nc_class_descriptor
lo-simon Sep 21, 2023
c1a9aca
Merge remote-tracking branch 'origin/master' into is-12
lo-simon Sep 25, 2023
84f13d4
Fix to handle empty NCP URL path
lo-simon Oct 6, 2023
645ff22
Code fix to construct nc_property_changed_event_data, thanks for @maw…
lo-simon Oct 6, 2023
472883e
Insert root block resource to the model will also inserting all its n…
lo-simon Oct 13, 2023
094f568
Add IS-12 to Readme
lo-simon Oct 13, 2023
3ff45a4
Add tounchpoint support and link Receiver-Monitor with IS-04/IS-05 Re…
lo-simon Oct 18, 2023
f8f5270
Add new headers to makefile
lo-simon Oct 18, 2023
264cfba
Set IS-12 nmos resource with relevant nmos::type
lo-simon Oct 19, 2023
ce62865
Clean up on how to construct propertry changed event
lo-simon Oct 19, 2023
f483ffd
Merge remote-tracking branch 'origin/master' into is-12
lo-simon Oct 23, 2023
28187d8
Add constraints support, see https://specs.amwa.tv/ms-05-02/branches/…
lo-simon Oct 26, 2023
677f66e
Update comments
lo-simon Oct 30, 2023
ad85dd0
typo
lo-simon Oct 30, 2023
613beaf
Add primitive types
lo-simon Oct 31, 2023
35de2d0
Merge remote-tracking branch 'origin/master' into is-12
lo-simon Nov 3, 2023
cbedf53
Add a simple temperature sensor example, which pumps out new temperat…
lo-simon Nov 3, 2023
d21ca75
Fix non-standard class's method handing
lo-simon Nov 7, 2023
f039f8f
Remove un-used code and fix typo
lo-simon Nov 8, 2023
98b4b56
Test readonly on set_sequence_item and add_sequence_item
lo-simon Nov 8, 2023
b14afef
Enhance level 0 datatype constraints validation
lo-simon Nov 14, 2023
0049eaa
Return property_deprecated(298) if property is marked as deprecated
lo-simon Nov 14, 2023
cf492a4
Code tidy-up
lo-simon Nov 14, 2023
93f69c2
Enhance non-standard example control method handlers, add level 2 and…
lo-simon Nov 14, 2023
d26bc32
Prevent comparsion warning
lo-simon Nov 14, 2023
2471b01
Reject Set on non-sequence value to sequence property
lo-simon Nov 15, 2023
4420e1e
Fix runtime and property sequence constraints validation
lo-simon Nov 15, 2023
bc5e0f5
Add method parameters constriants validation, and check method deprec…
lo-simon Nov 18, 2023
65e8ebb
Add comments
lo-simon Nov 20, 2023
092519e
No arguments object to those methods which do not require any arguments
lo-simon Nov 20, 2023
14aa16f
Add deprecated property and deprecated method to Example Control Class
lo-simon Nov 20, 2023
0bed427
Add logging for contraints validation
lo-simon Nov 21, 2023
64111a4
Merge branch 'master' into is-12
lo-simon Dec 22, 2023
4f83f38
Add property changed callback to perform application-specific operati…
lo-simon Jan 4, 2024
ea732da
Add authorization support to IS-12
lo-simon Jan 4, 2024
17bfd21
Merge remote-tracking branch 'origin/master' into is-12
lo-simon Jan 8, 2024
6fd4e78
Prevent warning C26800
lo-simon Jan 8, 2024
31321f7
Add ncp authorization field to IS-04 controls array of an NMOS Device
lo-simon Jan 10, 2024
ff3b9a3
Add IS-14 support
lo-simon Jan 10, 2024
e0a3755
Merge branch 'master' into is-14
lo-simon Mar 7, 2024
f685729
Add IS-14 schemas
lo-simon Mar 12, 2024
893f12d
Add GET /rolePaths and /rolePaths/{rolePath} support
lo-simon Mar 13, 2024
0124aa3
Merge branch 'master' into is-14
lo-simon Apr 11, 2024
a8794c5
Update comment
lo-simon Apr 12, 2024
05d6270
Update IS-14 schemas
lo-simon Apr 12, 2024
3a63684
Remove tabs with spaces
lo-simon Apr 12, 2024
c8eb564
IS-14 Added "/rolePaths/{rolePath}/properties" Endpoint (#1)
jonathan-r-thorpe Apr 22, 2024
b4a9038
Add const root block role
lo-simon Apr 23, 2024
a328772
Remove blanks
lo-simon Apr 24, 2024
143f4a0
Add /rolePaths/{rolePath}/methods endpoint
lo-simon Apr 24, 2024
96c5320
Remove blank
lo-simon Apr 25, 2024
d05ce02
Add /rolePaths/{rolePath}/descriptor endpoint, and tidy up
lo-simon Apr 25, 2024
7744eca
Add properties endpoint
jonathan-r-thorpe Apr 22, 2024
5adef6a
Update propertyId regular expression
jonathan-r-thorpe Apr 24, 2024
a4f6591
added /rolePaths/{rolePath}/property/{propertyId}/value and /rolePath…
jonathan-r-thorpe Apr 26, 2024
6788b1f
Fixed property id parsing
jonathan-r-thorpe Apr 26, 2024
e9306f2
Expose make_nc_method_result utility function
jonathan-r-thorpe Apr 26, 2024
f001640
Refactor method result creation
jonathan-r-thorpe Apr 26, 2024
c1d3c10
Fix descriptor endpoints to return NcMethodResult objects instead of …
jonathan-r-thorpe Apr 26, 2024
014cb37
Tidy up
lo-simon Apr 29, 2024
514468f
Add common functions and rename get_nc_object to get_nc_resource
lo-simon Apr 29, 2024
a3d05c2
Merge pull request #2 from lo-simon/is-14-properties-endpoint
lo-simon Apr 30, 2024
b2ae537
Add /rolePaths/{rolePath}/methods/{methodId} PATCH and /rolePaths/{ro…
lo-simon May 8, 2024
1e28e16
Make deprecated properties and methods return OK
jonathan-r-thorpe May 10, 2024
e51d708
Merge pull request #3 from lo-simon/is-14-deprecated
lo-simon May 16, 2024
b54931a
Pull command handle up to IS-12 command handling level to standard me…
jonathan-r-thorpe May 17, 2024
c0dc2f2
Removed and renamed command message response helper functions
jonathan-r-thorpe May 17, 2024
d2cca6d
Apply suggestions from code review
jonathan-r-thorpe May 20, 2024
3dec42a
Merge pull request #4 from lo-simon/refactor-is12-handle
lo-simon May 20, 2024
59da8c5
Added Device configuration data type definitions.
jonathan-r-thorpe May 21, 2024
cafa976
Merge branch 'sony:master' into is-14
lo-simon May 28, 2024
8f24340
Remove not in use code, thanks for @maweit suggestion
lo-simon May 28, 2024
173af96
Update Development/nmos/json_fields.h
jonathan-r-thorpe Jun 3, 2024
81d41ec
Merge pull request #5 from lo-simon/is-14-datatype-defs
lo-simon Jun 3, 2024
44f9857
Merge branch 'master' into is-14
lo-simon Jun 5, 2024
976d766
Modify using the updated version of the control method handler
lo-simon Jun 5, 2024
2588cfb
Add IS-14 bulkPropertiesManager object and endpoints (#7)
jonathan-r-thorpe Jun 19, 2024
3deaccb
Use the correct events for NcBulkPropertiesManager class descriptor
lo-simon Jun 20, 2024
bd9b59a
typo
lo-simon Jun 20, 2024
780c11a
Remove unused code
lo-simon Jun 20, 2024
66434d1
Merge branch 'master' into is-14
lo-simon Jun 21, 2024
226dc59
IS-14 Refactor bulkProperties methods (#8)
jonathan-r-thorpe Jul 14, 2024
4f3de3e
Merge branch 'master' into is-14
lo-simon Aug 1, 2024
7830330
Remove redundant parameters.
jonathan-r-thorpe Aug 6, 2024
b14f570
Apply suggestions from code review
jonathan-r-thorpe Aug 16, 2024
dd7185b
Merge pull request #9 from lo-simon/remove_redundant_params
lo-simon Sep 4, 2024
fa2eea2
Changed ncp_nmos_resource_type to ncp_touchpoint_resource_type
jonathan-r-thorpe Sep 4, 2024
8210589
Generalize find_control_protocol_resource
jonathan-r-thorpe Sep 4, 2024
87cfb85
Remove redundant parameters
jonathan-r-thorpe Sep 4, 2024
9f68dbf
Merge pull request #10 from lo-simon/is-14-simplify
lo-simon Sep 4, 2024
5e2847c
Merge branch 'master' into is-14
jonathan-r-thorpe Nov 6, 2024
5f4ddd3
merge_patch doesn't work when argument value is null
jonathan-r-thorpe Nov 27, 2024
22cb52a
Updated IS-14 datatypes, class and schemas
jonathan-r-thorpe Nov 28, 2024
2357a2f
Merge branch 'sony:master' into is-14
lo-simon Dec 5, 2024
131ddc9
Apply suggestions from code review
jonathan-r-thorpe Dec 6, 2024
6ad0c67
Remove property_trait enum
jonathan-r-thorpe Nov 29, 2024
2db7901
Merge pull request #12 from lo-simon/is-14-updates
lo-simon Dec 6, 2024
36c9566
Merge branch 'master' into is-14
jonathan-r-thorpe Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add GetControlClass, and GetDataType
lo-simon committed Aug 15, 2023
commit 5d5e2b8d0b91a106f43e5c070dd362499c6173bb
2 changes: 2 additions & 0 deletions Development/cmake/NmosCppLibraries.cmake
Original file line number Diff line number Diff line change
@@ -831,6 +831,7 @@ set(NMOS_CPP_NMOS_SOURCES
nmos/connection_api.cpp
nmos/connection_events_activation.cpp
nmos/connection_resources.cpp
nmos/control_protocol_class_id.cpp
nmos/control_protocol_handlers.cpp
nmos/control_protocol_resource.cpp
nmos/control_protocol_resources.cpp
@@ -910,6 +911,7 @@ set(NMOS_CPP_NMOS_HEADERS
nmos/connection_api.h
nmos/connection_events_activation.h
nmos/connection_resources.h
nmos/control_protocol_class_id.h
nmos/control_protocol_handlers.h
nmos/control_protocol_resource.h
nmos/control_protocol_resources.h
1 change: 1 addition & 0 deletions Development/nmos-cpp-node/main.cpp
Original file line number Diff line number Diff line change
@@ -111,6 +111,7 @@ int main(int argc, char* argv[])

nmos::experimental::control_protocol_state control_protocol_state;
node_implementation.on_get_control_classes(nmos::make_get_control_protocol_classes_handler(control_protocol_state, gate));
node_implementation.on_get_control_datatypes(nmos::make_get_control_protocol_datatypes_handler(control_protocol_state, gate));

// Set up the node server

27 changes: 27 additions & 0 deletions Development/nmos/control_protocol_class_id.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "nmos/control_protocol_class_id.h"

namespace nmos
{
namespace details
{
// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassid
web::json::value make_nc_class_id(const nc_class_id& class_id)
{
using web::json::value;

auto nc_class_id = value::array();
for (const auto class_id_item : class_id) { web::json::push_back(nc_class_id, class_id_item); }
return nc_class_id;
}

nc_class_id parse_nc_class_id(const web::json::array& class_id_)
{
nc_class_id class_id;
for (auto& element : class_id_)
{
class_id.push_back(element.as_integer());
}
return class_id;
}
}
}
19 changes: 19 additions & 0 deletions Development/nmos/control_protocol_class_id.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef NMOS_CONTROL_PROTOCOL_CLASS_ID_H
#define NMOS_CONTROL_PROTOCOL_CLASS_ID_H

#include "cpprest/json_utils.h"

namespace nmos
{
namespace details
{
// see https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassid
typedef std::vector<int32_t> nc_class_id;

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassid
web::json::value make_nc_class_id(const nc_class_id& class_id);
nc_class_id parse_nc_class_id(const web::json::array& class_id);
}
}

#endif
48 changes: 29 additions & 19 deletions Development/nmos/control_protocol_handlers.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "nmos/control_protocol_handlers.h"

#include "cpprest/basic_utils.h"
#include "nmos/control_protocol_state.h"
#include "nmos/slog.h"

namespace nmos
@@ -18,28 +16,28 @@ namespace nmos
};
}

get_control_protocol_class_handler make_get_control_protocol_class_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate)
{
return [&](const details::nc_class_id& class_id)
{
using web::json::value;
//get_control_protocol_class_handler make_get_control_protocol_class_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate)
//{
// return [&](const details::nc_class_id& class_id)
// {
// using web::json::value;

slog::log<slog::severities::more_info>(gate, SLOG_FLF) << "Retrieve control class from cache";
// slog::log<slog::severities::more_info>(gate, SLOG_FLF) << "Retrieve control class from cache";

auto lock = control_protocol_state.read_lock();
// auto lock = control_protocol_state.read_lock();

auto class_id_data = details::make_nc_class_id(class_id);
// auto class_id_data = details::make_nc_class_id(class_id);

auto& control_classes = control_protocol_state.control_classes;
auto found = control_classes.find(class_id_data);
if (control_classes.end() != found)
{
return found->second;
}
// auto& control_classes = control_protocol_state.control_classes;
// auto found = control_classes.find(class_id_data);
// if (control_classes.end() != found)
// {
// return found->second;
// }

return experimental::control_class{ value::array(), value::array(), value::array() };
};
}
// return experimental::control_class{ value::array(), value::array(), value::array() };
// };
//}

add_control_protocol_class_handler make_add_control_protocol_class_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate)
{
@@ -61,4 +59,16 @@ namespace nmos
return true;
};
}

get_control_protocol_datatypes_handler make_get_control_protocol_datatypes_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate)
{
return [&]()
{
slog::log<slog::severities::more_info>(gate, SLOG_FLF) << "Retrieve all datatypes from cache";

auto lock = control_protocol_state.read_lock();

return control_protocol_state.datatypes;
};
}
}
15 changes: 10 additions & 5 deletions Development/nmos/control_protocol_handlers.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#ifndef NMOS_CONTROL_PROTOCOL_HANDLERS_H
#define NMOS_CONTROL_PROTOCOL_HANDLERS_H

#include <cstdint>
#include <functional>
#include "nmos/control_protocol_resource.h"
#include "nmos/control_protocol_state.h"

namespace slog
@@ -15,8 +13,8 @@ namespace nmos
{
namespace experimental
{
struct control_class;
struct control_protocol_state;
struct control_class;
}

// callback to retrieve all control protocol classes
@@ -25,20 +23,27 @@ namespace nmos

// callback to retrieve a specific control protocol class
// this callback should not throw exceptions
typedef std::function<experimental::control_class(const details::nc_class_id& class_id)> get_control_protocol_class_handler;
// typedef std::function<experimental::control_class(const details::nc_class_id& class_id)> get_control_protocol_class_handler;

// callback to add user control protocol class
// this callback should not throw exceptions
typedef std::function<bool(const details::nc_class_id& class_id, const experimental::control_class& control_class)> add_control_protocol_class_handler;

// callback to retrieve all control protocol datatypes
// this callback should not throw exceptions
typedef std::function<experimental::datatypes()> get_control_protocol_datatypes_handler;

// construct callback to retrieve all control protocol classes
get_control_protocol_classes_handler make_get_control_protocol_classes_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate);

// construct callback to retrieve control protocol class
get_control_protocol_class_handler make_get_control_protocol_class_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate);
// get_control_protocol_class_handler make_get_control_protocol_class_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate);

// construct callback to add control protocol class
add_control_protocol_class_handler make_add_control_protocol_class_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate);

// construct callback to retrieve all datatypes
get_control_protocol_datatypes_handler make_get_control_protocol_datatypes_handler(nmos::experimental::control_protocol_state& control_protocol_state, slog::base_gate& gate);
}

#endif
29 changes: 5 additions & 24 deletions Development/nmos/control_protocol_resource.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "nmos/control_protocol_resource.h"

//#include "nmos/resource.h"
#include "nmos/control_protocol_state.h" // for nmos::experimental::control_classes definitions
#include "nmos/json_fields.h"

namespace nmos
@@ -92,26 +93,6 @@ namespace nmos
});
}

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassid
web::json::value make_nc_class_id(const nc_class_id& class_id)
{
using web::json::value;

auto nc_class_id = value::array();
for (const auto class_id_item : class_id) { web::json::push_back(nc_class_id, class_id_item); }
return nc_class_id;
}

nc_class_id parse_nc_class_id(const web::json::array& class_id_)
{
nc_class_id class_id;
for (auto& element : class_id_)
{
class_id.push_back(element.as_integer());
}
return class_id;
}

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncelementid
web::json::value make_nc_element_id(uint16_t level, uint16_t index)
{
@@ -795,7 +776,7 @@ namespace nmos
return make_nc_datatype_descriptor_struct(value::string(U("Id method result")), U("NcMethodResultId"), value::null(), fields, value::string(U("NcMethodResult")));
}

web::json::value make_method_result_length_datatype()
web::json::value make_nc_method_result_length_datatype()
{
using web::json::value;

@@ -1152,11 +1133,11 @@ namespace nmos
}

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassmanager
web::json::value make_nc_class_manager(nc_oid oid, nc_oid owner, const web::json::value& user_label)
web::json::value make_nc_class_manager(nc_oid oid, nc_oid owner, const web::json::value& user_label, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints)
{
using web::json::value;

auto data = make_nc_manager(nc_class_manager_class_id, oid, true, owner, U("ClassManager"), user_label);
auto data = make_nc_manager(nc_class_manager_class_id, oid, true, owner, U("ClassManager"), user_label, touchpoints, runtime_property_constraints);

// minimal control classes
data[nmos::fields::nc::control_classes] = value::array();
@@ -1203,7 +1184,7 @@ namespace nmos
// NcMethodResultId
web::json::push_back(datatypes, make_nc_method_result_id_datatype());
// NcMethodResultLength
web::json::push_back(datatypes, make_method_result_length_datatype());
web::json::push_back(datatypes, make_nc_method_result_length_datatype());
// NcPropertyChangeType
web::json::push_back(datatypes, make_nc_property_change_type_datatype());
// NcPropertyChangedEventData
60 changes: 48 additions & 12 deletions Development/nmos/control_protocol_resource.h
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@

#include <map>
#include "cpprest/json_utils.h"
#include "nmos/control_protocol_class_id.h"
#include "nmos/control_protocol_state.h" // for nmos::experimental::control_classes definitions

namespace web
{
@@ -126,7 +128,6 @@ namespace nmos
typedef utility::string_t nc_uuid;

// see https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassid
typedef std::vector<int32_t> nc_class_id;
const nc_class_id nc_object_class_id({ 1 });
const nc_class_id nc_block_class_id({ 1, 1 });
const nc_class_id nc_worker_class_id({ 1, 2 });
@@ -137,9 +138,7 @@ namespace nmos
// see https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#nctouchpoint
typedef utility::string_t nc_touch_point;

typedef std::map<web::json::value, utility::string_t> properties;

typedef std::function<web::json::value(const web::json::array& properties, int32_t handle, int32_t oid, const web::json::value& arguments)> method;
typedef std::function<web::json::value(const web::json::array& properties, int32_t handle, int32_t oid, const web::json::value& arguments, const nmos::experimental::control_classes& control_classes, const nmos::experimental::datatypes& datatypes)> method;
typedef std::map<web::json::value, method> methods; // method_id vs method handler

web::json::value make_control_protocol_error_response(int32_t handle, const nc_method_result& method_result, const utility::string_t& error_message);
@@ -160,10 +159,6 @@ namespace nmos
// See https://specs.amwa.tv/is-12/branches/v1.0-dev/docs/Protocol_messaging.html#error-messages
web::json::value make_control_protocol_error_message(const nc_method_result& method_result, const utility::string_t& error_message);

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassid
web::json::value make_nc_class_id(const nc_class_id& class_id);
nc_class_id parse_nc_class_id(const web::json::array& class_id);

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncelementid
web::json::value make_nc_element_id(uint16_t level, uint16_t index);

@@ -202,7 +197,7 @@ namespace nmos
// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassdescriptor
// description can be null
// fixedRole can be null
web::json::value make_nc_class_descriptor(const web::json::value& description, const web::json::value& class_id, const utility::string_t& name, const web::json::value& fixed_role, const web::json::value& properties, const web::json::value& methods, const web::json::value& events);
web::json::value make_nc_class_descriptor(const web::json::value& description, const nc_class_id& class_id, const utility::string_t& name, const web::json::value& fixed_role, const web::json::value& properties, const web::json::value& methods, const web::json::value& events);

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncenumitemdescriptor
// description can be null
@@ -266,7 +261,7 @@ namespace nmos
// constraints can be null
web::json::value make_nc_datatype_typedef(const web::json::value& description, const utility::string_t& name, const web::json::value& constraints, const utility::string_t& parent_type, bool is_sequence);

// make the core classes proprties/methods/events
// make the core control classes proprties/methods/events
web::json::value make_nc_object_properties();
web::json::value make_nc_object_methods();
web::json::value make_nc_object_events();
@@ -286,22 +281,63 @@ namespace nmos
web::json::value make_nc_class_manager_methods();
web::json::value make_nc_class_manager_events();

// make the core datatypes
web::json::value make_nc_class_id_datatype();
web::json::value make_nc_oid_datatype();
web::json::value make_nc_touchpoint_datatype();
web::json::value make_nc_element_id_datatype();
web::json::value make_nc_property_id_datatype();
web::json::value make_nc_property_contraints_datatype();
web::json::value make_nc_method_result_property_value_datatype();
web::json::value make_nc_method_status_datatype();
web::json::value make_nc_method_result_datatype();
web::json::value make_nc_id_datatype();
web::json::value make_nc_method_result_id_datatype();
web::json::value make_nc_method_result_length_datatype();
web::json::value make_nc_property_change_type_datatype();
web::json::value make_nc_property_changed_event_data_datatype();
web::json::value make_nc_descriptor_datatype();
web::json::value make_nc_block_member_descriptor_datatype();
web::json::value make_nc_method_result_block_member_descriptors_datatype();
web::json::value make_nc_version_code_datatype();
web::json::value make_nc_organization_id_datatype();
web::json::value make_nc_uri_datatype();
web::json::value make_nc_manufacturer_datatype();
web::json::value make_nc_uuid_datatype();
web::json::value make_nc_product_datatype();
web::json::value make_nc_device_generic_state_datatype();
web::json::value make_nc_device_operational_state_datatype();
web::json::value make_nc_reset_cause_datatype();
web::json::value make_nc_name_datatype();
web::json::value make_nc_property_descriptor_datatype();
web::json::value make_nc_parameter_descriptor_datatype();
web::json::value make_nc_method_id_datatype();
web::json::value make_nc_method_descriptor_datatype();
web::json::value make_nc_event_id_datatype();
web::json::value make_nc_event_descriptor_datatype();
web::json::value make_nc_class_descriptor_datatype();
web::json::value make_nc_parameter_constraints_datatype();
web::json::value make_nc_datatype_type_datatype();
web::json::value make_nc_datatype_descriptor_datatype();
web::json::value make_nc_method_result_class_descriptor_datatype();
web::json::value make_nc_method_result_datatype_descriptor_datatype();

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncobject
web::json::value make_nc_object(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 web::json::value& touchpoints, const web::json::value& runtime_property_constraints);

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncblock
web::json::value make_nc_block(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 web::json::value& touchpoints, const web::json::value& runtime_property_constraints, bool enabled, const web::json::value& members);

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/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 web::json::value& touchpoints = web::json::value::null(), const web::json::value& runtime_property_constraints = web::json::value::null());
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 web::json::value& touchpoints, const web::json::value& runtime_property_constraints);

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncdevicemanager
web::json::value make_nc_device_manager(nc_oid oid, nc_oid owner, const web::json::value& user_label, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints,
const web::json::value& manufacturer, const web::json::value& product, const utility::string_t& serial_number,
const web::json::value& user_inventory_code, const web::json::value& device_name, const web::json::value& device_role, const web::json::value& operational_state, nc_reset_cause::cause reset_cause);

// See https://specs.amwa.tv/ms-05-02/branches/v1.0-dev/docs/Framework.html#ncclassmanager
web::json::value make_nc_class_manager(details::nc_oid oid, nc_oid owner, const web::json::value& user_label);
web::json::value make_nc_class_manager(details::nc_oid oid, nc_oid owner, const web::json::value& user_label, const web::json::value& touchpoints, const web::json::value& runtime_property_constraints);
}
}

6 changes: 3 additions & 3 deletions Development/nmos/control_protocol_resources.cpp
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@ namespace nmos
manufacturer, product, serial_number, value::null(), device_name, device_role, operational_state, details::nc_reset_cause::Unknown);

// add NcDeviceManager block_member_descriptor to root block members
web::json::push_back(root_block_data[nmos::fields::nc::members], details::make_nc_block_member_descriptor(
description, nmos::fields::nc::role(data), oid, nmos::fields::nc::constant_oid(data), data.at(nmos::fields::nc::class_id), user_label, owner));
web::json::push_back(root_block_data[nmos::fields::nc::members],
details::make_nc_block_member_descriptor(description, nmos::fields::nc::role(data), oid, nmos::fields::nc::constant_oid(data), data.at(nmos::fields::nc::class_id), user_label, owner));

return{ is12_versions::v1_0, types::nc_device_manager, std::move(data), true };
}
@@ -42,7 +42,7 @@ namespace nmos
const auto user_label = value::string(U("Class manager"));
const auto description = value::string(U("The class manager offers access to control class and data type descriptors"));

auto data = details::make_nc_class_manager(oid, owner, user_label);
auto data = details::make_nc_class_manager(oid, owner, user_label, value::null(), value::null());

// add NcClassManager block_member_descriptor to root block members
web::json::push_back(root_block_data[nmos::fields::nc::members],
62 changes: 54 additions & 8 deletions Development/nmos/control_protocol_state.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,68 @@
#include "nmos/control_protocol_state.h"

#include "nmos/control_protocol_resource.h"
#include "nmos/control_protocol_resource.h" // for nc_object_class_id, nc_block_class_id, nc_worker_class_id, nc_manager_class_id, nc_device_manager_class_id, nc_class_manager_class_id definitions

namespace nmos
{
namespace experimental
{
control_protocol_state::control_protocol_state()
{
// setup the core control classes (properties/methods/events)
using web::json::value;

// setup the core control classes
control_classes =
{
{ details::make_nc_class_id(details::nc_object_class_id), { details::make_nc_object_properties(), details::make_nc_object_methods(), details::make_nc_object_events() } },
{ details::make_nc_class_id(details::nc_block_class_id), { details::make_nc_block_properties(), details::make_nc_block_methods(), details::make_nc_block_events() } },
{ details::make_nc_class_id(details::nc_worker_class_id), { details::make_nc_worker_properties(), details::make_nc_worker_methods(), details::make_nc_worker_events() } },
{ details::make_nc_class_id(details::nc_manager_class_id), { details::make_nc_manager_properties(), details::make_nc_manager_methods(), details::make_nc_manager_events() } },
{ details::make_nc_class_id(details::nc_device_manager_class_id), { details::make_nc_device_manager_properties(), details::make_nc_device_manager_methods(), details::make_nc_device_manager_events() } },
{ details::make_nc_class_id(details::nc_class_manager_class_id), { details::make_nc_class_manager_properties(), details::make_nc_class_manager_methods(), details::make_nc_class_manager_events() } }
{ details::make_nc_class_id(details::nc_object_class_id), { value::string(U("NcObject class descriptor")), details::nc_object_class_id, U("NcObject"), value::null(), details::make_nc_object_properties(), details::make_nc_object_methods(), details::make_nc_object_events() } },
{ details::make_nc_class_id(details::nc_block_class_id), { value::string(U("NcBlock class descriptor")), details::nc_block_class_id, U("NcBlock"), value::null(), details::make_nc_block_properties(), details::make_nc_block_methods(), details::make_nc_block_events() } },
{ details::make_nc_class_id(details::nc_worker_class_id), { value::string(U("NcWorker class descriptor")), details::nc_worker_class_id, U("NcWorker"), value::null(), details::make_nc_worker_properties(), details::make_nc_worker_methods(), details::make_nc_worker_events() } },
{ details::make_nc_class_id(details::nc_manager_class_id), { value::string(U("NcManager class descriptor")), details::nc_manager_class_id, U("NcManager"), value::null(), details::make_nc_manager_properties(), details::make_nc_manager_methods(), details::make_nc_manager_events() } },
{ details::make_nc_class_id(details::nc_device_manager_class_id), { value::string(U("NcDeviceManager class descriptor")), details::nc_device_manager_class_id, U("NcDeviceManager"), value::string(U("DeviceManager")), details::make_nc_device_manager_properties(), details::make_nc_device_manager_methods(), details::make_nc_device_manager_events() } },
{ details::make_nc_class_id(details::nc_class_manager_class_id), { value::string(U("NcClassManager class descriptor")), details::nc_class_manager_class_id, U("NcClassManager"), value::string(U("ClassManager")), details::make_nc_class_manager_properties(), details::make_nc_class_manager_methods(), details::make_nc_class_manager_events() } }
};

// setup the core datatypes
datatypes =
{
{ U("NcClassId"), {details::make_nc_class_id_datatype()} },
{ U("NcOid"), {details::make_nc_oid_datatype()} },
{ U("NcTouchpoint"), {details::make_nc_touchpoint_datatype()} },
{ U("NcElementId"), {details::make_nc_element_id_datatype()} },
{ U("NcPropertyId"), {details::make_nc_property_id_datatype()} },
{ U("NcPropertyConstraints"), {details::make_nc_property_contraints_datatype()} },
{ U("NcMethodResultPropertyValue"), {details::make_nc_method_result_property_value_datatype()} },
{ U("NcMethodStatus"), {details::make_nc_method_status_datatype()} },
{ U("NcMethodResult"), {details::make_nc_method_result_datatype()} },
{ U("NcId"), {details::make_nc_id_datatype()} },
{ U("NcMethodResultId"), {details::make_nc_method_result_id_datatype()} },
{ U("NcMethodResultLength"), {details::make_nc_method_result_length_datatype()} },
{ U("NcPropertyChangeType"), {details::make_nc_property_change_type_datatype()} },
{ U("NcPropertyChangedEventData"), {details::make_nc_property_changed_event_data_datatype()} },
{ U("NcDescriptor"), {details::make_nc_descriptor_datatype()} },
{ U("NcBlockMemberDescriptor"), {details::make_nc_block_member_descriptor_datatype()} },
{ U("NcMethodResultBlockMemberDescriptors"), {details::make_nc_method_result_block_member_descriptors_datatype()} },
{ U("NcVersionCode"), {details::make_nc_version_code_datatype()} },
{ U("NcOrganizationId"), {details::make_nc_organization_id_datatype()} },
{ U("NcUri"), {details::make_nc_uri_datatype()} },
{ U("NcManufacturer"), {details::make_nc_manufacturer_datatype()} },
{ U("NcUuid"), {details::make_nc_uuid_datatype()} },
{ U("NcProduct"), {details::make_nc_product_datatype()} },
{ U("NcDeviceGenericState"), {details::make_nc_device_generic_state_datatype()} },
{ U("NcDeviceOperationalState"), {details::make_nc_device_operational_state_datatype()} },
{ U("NcResetCause"), {details::make_nc_reset_cause_datatype()} },
{ U("NcName"), {details::make_nc_name_datatype()} },
{ U("NcPropertyDescriptor"), {details::make_nc_property_descriptor_datatype()} },
{ U("NcParameterDescriptor"), {details::make_nc_parameter_descriptor_datatype()} },
{ U("NcMethodId"), {details::make_nc_method_id_datatype()} },
{ U("NcMethodDescriptor"), {details::make_nc_method_descriptor_datatype()} },
{ U("NcEventId"), {details::make_nc_event_id_datatype()} },
{ U("NcEventDescriptor"), {details::make_nc_event_descriptor_datatype()} },
{ U("NcClassDescriptor"), {details::make_nc_class_descriptor_datatype()} },
{ U("NcParameterConstraints"), {details::make_nc_parameter_constraints_datatype()} },
{ U("NcDatatypeType"), {details::make_nc_datatype_type_datatype()} },
{ U("NcDatatypeDescriptor"), {details::make_nc_datatype_descriptor_datatype()} },
{ U("NcMethodResultClassDescriptor"), {details::make_nc_method_result_class_descriptor_datatype()} },
{ U("NcMethodResultDatatypeDescriptor"), {details::make_nc_method_result_datatype_descriptor_datatype()} }
};
}
}
38 changes: 37 additions & 1 deletion Development/nmos/control_protocol_state.h
Original file line number Diff line number Diff line change
@@ -3,27 +3,63 @@

#include <map>
#include "cpprest/json_utils.h"
#include "nmos/control_protocol_class_id.h" // for nmos::details::nc_class_id definitions
#include "nmos/mutex.h"

namespace nmos
{
namespace experimental
{
struct control_class
struct control_class // NcClassDescriptor
{
web::json::value description;
nmos::details::nc_class_id class_id;
utility::string_t name;
web::json::value fixed_role;

web::json::value properties; // array of nc_property_descriptor
web::json::value methods; // array of nc_method_descriptor
web::json::value events; // array of nc_event_descriptor

//control_class(details::nc_class_id class_id, utility::string_t name, web::json::value fixed_role, web::json::value properties, web::json::value methods, web::json::value events)
// : description(web::json::value::null())
// , class_id(std::move(class_id))
// , name(std::move(name))
// , fixed_role(std::move(fixed_role))
// , properties(std::move(properties))
// , methods(std::move(methods))
// , events(std::move(events))
//{}

//control_class(const utility::string_t& description, details::nc_class_id class_id, utility::string_t name, web::json::value fixed_role, web::json::value properties, web::json::value methods, web::json::value events)
// : description(web::json::value::string(description))
// , class_id(std::move(class_id))
// , name(std::move(name))
// , fixed_role(std::move(fixed_role))
// , properties(std::move(properties))
// , methods(std::move(methods))
// , events(std::move(events))
//{}

};

struct datatype // NcDatatypeDescriptorEnum/NcDatatypeDescriptorPrimitive/NcDatatypeDescriptorStruct/NcDatatypeDescriptorTypeDef
{
web::json::value descriptor;
};

// nc_class_id vs control_class
typedef std::map<web::json::value, control_class> control_classes;
// nc_name vs datatype
typedef std::map<utility::string_t, datatype> datatypes;

struct control_protocol_state
{
// mutex to be used to protect the members from simultaneous access by multiple threads
mutable nmos::mutex mutex;

experimental::control_classes control_classes;
experimental::datatypes datatypes;

nmos::read_lock read_lock() const { return nmos::read_lock{ mutex }; }
nmos::write_lock write_lock() const { return nmos::write_lock{ mutex }; }
3 changes: 1 addition & 2 deletions Development/nmos/control_protocol_utils.cpp
Original file line number Diff line number Diff line change
@@ -4,11 +4,10 @@
#include <boost/algorithm/string/find.hpp>
#include <boost/iterator/filter_iterator.hpp>
#include "cpprest/json_utils.h"
#include "nmos/control_protocol_resource.h" // for nc_object_class_id, nc_manager_class_id, nc_device_manager_class_id, nc_class_manager_class_id
#include "nmos/json_fields.h"
#include "nmos/resources.h"

#include "nmos/control_protocol_resource.h" // for nc_class_id

namespace nmos
{
namespace details
13 changes: 12 additions & 1 deletion Development/nmos/control_protocol_utils.h
Original file line number Diff line number Diff line change
@@ -2,11 +2,22 @@
#define NMOS_CONTROL_PROTOCOL_UTILS_H

#include "cpprest/basic_utils.h"
#include "nmos/control_protocol_resource.h" // for nc_class_id definition
#include "nmos/control_protocol_class_id.h" // for nc_class_id definition
#include "nmos/resources.h"

namespace nmos
{
namespace details
{
bool is_nc_block(const nc_class_id& class_id);

bool is_nc_manager(const nc_class_id& class_id);

bool is_nc_device_manager(const nc_class_id& class_id);

bool is_nc_class_manager(const nc_class_id& class_id);
}

void get_member_descriptors(const resources& resources, resources::iterator resource, bool recurse, web::json::array& descriptors);

void find_members_by_role(const resources& resources, resources::iterator resource, const utility::string_t& role, bool match_whole_string, bool case_sensitive, bool recurse, web::json::array& nc_block_member_descriptors);
372 changes: 253 additions & 119 deletions Development/nmos/control_protocol_ws_api.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Development/nmos/control_protocol_ws_api.h
Original file line number Diff line number Diff line change
@@ -16,15 +16,15 @@ namespace nmos
web::websockets::experimental::listener::validate_handler make_control_protocol_ws_validate_handler(nmos::node_model& model, slog::base_gate& gate);
web::websockets::experimental::listener::open_handler make_control_protocol_ws_open_handler(nmos::node_model& model, nmos::websockets& websockets, slog::base_gate& gate);
web::websockets::experimental::listener::close_handler make_control_protocol_ws_close_handler(nmos::node_model& model, nmos::websockets& websockets, slog::base_gate& gate);
web::websockets::experimental::listener::message_handler make_control_protocol_ws_message_handler(nmos::node_model& model, nmos::websockets& websockets, nmos::get_control_protocol_classes_handler get_control_protocol_classes, slog::base_gate& gate);
web::websockets::experimental::listener::message_handler make_control_protocol_ws_message_handler(nmos::node_model& model, nmos::websockets& websockets, nmos::get_control_protocol_classes_handler get_control_protocol_classes, nmos::get_control_protocol_datatypes_handler get_control_protocol_datatypes, slog::base_gate& gate);

inline web::websockets::experimental::listener::websocket_listener_handlers make_control_protocol_ws_api(nmos::node_model& model, nmos::websockets& websockets, nmos::get_control_protocol_classes_handler get_control_protocol_classes, slog::base_gate& gate)
inline web::websockets::experimental::listener::websocket_listener_handlers make_control_protocol_ws_api(nmos::node_model& model, nmos::websockets& websockets, nmos::get_control_protocol_classes_handler get_control_protocol_classes, nmos::get_control_protocol_datatypes_handler get_control_protocol_datatypes, slog::base_gate& gate)
{
return{
nmos::make_control_protocol_ws_validate_handler(model, gate),
nmos::make_control_protocol_ws_open_handler(model, websockets, gate),
nmos::make_control_protocol_ws_close_handler(model, websockets, gate),
nmos::make_control_protocol_ws_message_handler(model, websockets, get_control_protocol_classes, gate)
nmos::make_control_protocol_ws_message_handler(model, websockets, get_control_protocol_classes, get_control_protocol_datatypes, gate)
};
}

2 changes: 1 addition & 1 deletion Development/nmos/node_server.cpp
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ namespace nmos
const auto& control_protocol_ws_port = nmos::fields::control_protocol_ws_port(node_model.settings);
if (control_protocol_ws_port == events_ws_port) throw std::runtime_error("Same port used for events and control protocol websockets are not supported");
auto& control_protocol_ws_api = node_server.ws_handlers[{ {}, control_protocol_ws_port }];
control_protocol_ws_api.first = nmos::make_control_protocol_ws_api(node_model, control_protocol_ws_api.second, node_implementation.get_control_protocol_classes, gate);
control_protocol_ws_api.first = nmos::make_control_protocol_ws_api(node_model, control_protocol_ws_api.second, node_implementation.get_control_protocol_classes, node_implementation.get_control_protocol_datatypes, gate);

// Set up the listeners for each HTTP API port

5 changes: 4 additions & 1 deletion Development/nmos/node_server.h
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ namespace nmos
// underlying implementation into the server instance for the NMOS Node
struct node_implementation
{
node_implementation(nmos::load_server_certificates_handler load_server_certificates, nmos::load_dh_param_handler load_dh_param, nmos::load_ca_certificates_handler load_ca_certificates, nmos::system_global_handler system_changed, nmos::registration_handler registration_changed, nmos::transport_file_parser parse_transport_file, nmos::details::connection_resource_patch_validator validate_staged, nmos::connection_resource_auto_resolver resolve_auto, nmos::connection_sender_transportfile_setter set_transportfile, nmos::connection_activation_handler connection_activated, nmos::ocsp_response_handler get_ocsp_response, nmos::get_control_protocol_classes_handler get_control_protocol_classes)
node_implementation(nmos::load_server_certificates_handler load_server_certificates, nmos::load_dh_param_handler load_dh_param, nmos::load_ca_certificates_handler load_ca_certificates, nmos::system_global_handler system_changed, nmos::registration_handler registration_changed, nmos::transport_file_parser parse_transport_file, nmos::details::connection_resource_patch_validator validate_staged, nmos::connection_resource_auto_resolver resolve_auto, nmos::connection_sender_transportfile_setter set_transportfile, nmos::connection_activation_handler connection_activated, nmos::ocsp_response_handler get_ocsp_response, nmos::get_control_protocol_classes_handler get_control_protocol_classes, nmos::get_control_protocol_datatypes_handler get_control_protocol_datatypes)
: load_server_certificates(std::move(load_server_certificates))
, load_dh_param(std::move(load_dh_param))
, load_ca_certificates(std::move(load_ca_certificates))
@@ -38,6 +38,7 @@ namespace nmos
, connection_activated(std::move(connection_activated))
, get_ocsp_response(std::move(get_ocsp_response))
, get_control_protocol_classes(std::move(get_control_protocol_classes))
, get_control_protocol_datatypes(std::move(get_control_protocol_datatypes))
{}

// use the default constructor and chaining member functions for fluent initialization
@@ -60,6 +61,7 @@ namespace nmos
node_implementation& on_channelmapping_activated(nmos::channelmapping_activation_handler channelmapping_activated) { this->channelmapping_activated = std::move(channelmapping_activated); return *this; }
node_implementation& on_get_ocsp_response(nmos::ocsp_response_handler get_ocsp_response) { this->get_ocsp_response = std::move(get_ocsp_response); return *this; }
node_implementation& on_get_control_classes(nmos::get_control_protocol_classes_handler get_control_protocol_classes) { this->get_control_protocol_classes = std::move(get_control_protocol_classes); return* this; }
node_implementation& on_get_control_datatypes(nmos::get_control_protocol_datatypes_handler get_control_protocol_datatypes) { this->get_control_protocol_datatypes = std::move(get_control_protocol_datatypes); return*this; }

// deprecated, use on_validate_connection_resource_patch
node_implementation& on_validate_merged(nmos::details::connection_resource_patch_validator validate_merged) { return on_validate_connection_resource_patch(std::move(validate_merged)); }
@@ -91,6 +93,7 @@ namespace nmos
nmos::ocsp_response_handler get_ocsp_response;

nmos::get_control_protocol_classes_handler get_control_protocol_classes;
nmos::get_control_protocol_datatypes_handler get_control_protocol_datatypes;
};

// Construct a server instance for an NMOS Node, implementing the IS-04 Node API, IS-05 Connection API, IS-07 Events API