-
Notifications
You must be signed in to change notification settings - Fork 75
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
Json meta to IDL changes #394
base: master
Are you sure you want to change the base?
Json meta to IDL changes #394
Conversation
definitions/CMakeLists.txt
Outdated
@@ -35,6 +35,16 @@ set(WORKING_VARIABLE ${JSONRPC_PATTERNS}) | |||
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/jsonrpc/") | |||
file(GLOB JSON_FILE ${WORKING_VARIABLE}) | |||
|
|||
if(NOT ENABLE_LEGACY_INTERFACE_SUPPORT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope we can just remove these json files from the repository... so no need to remove them only from the Cmake. If you remove them from the directory they will aslo not end up in the list..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but actually I have added this flag to retain the json files to support older interfaces
4d86f68
to
8c69e90
Compare
interfaces/IDeviceInfo.h
Outdated
|
||
// @property | ||
// @brief Retrieves Device Info | ||
virtual Core::hresult DeviceData(Device& device /* @out */) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for consistency, if possible, call these methods like the interface bu than without the I, so:
virtual Core::hresult DeviceMetadata(Device& device /* @out */) const = 0;
interfaces/IDeviceInfo.h
Outdated
|
||
// @property | ||
// @brief Retrieves Firware Information | ||
virtual Core::hresult FirmwareInfo(Firmware& firmware /* @out */) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for consistency, if possible, call these methods like the interface bu than without the I, so:
virtual Core::hresult ImageMetadata(Firmware& device /* @out */) const = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
|
||
// @property | ||
// @brief Retrieves SystemInfo | ||
virtual Core::hresult SystemInfo(System& system /* @out */) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for consistency, if possible, call these methods like the interface bu than without the I, so:
virtual Core::hresult SystemMetadata(System& device /* @out */) const = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
|
||
// @property | ||
// @brief Retrieves SocketInfo | ||
virtual Core::hresult SocketInfo(Socket& socket /* @out */) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for consistency, if possible, call these methods like the interface bu than without the I, so:
virtual Core::hresult SocketMetadata(Socket& device /* @out */) const = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
// @property | ||
// @brief Retrieves AddressInfo | ||
// @param addresses: An array of Interface address | ||
virtual Core::hresult AddressInfo(IAddressIterator*& ip /* @out */) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for consistency, if possible, call these methods like the interface bu than without the I, so:
virtual Core::hresult AddressMetadata(IAddressIterator*& ip /* @out */ const = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
@@ -25,136 +25,315 @@ | |||
|
|||
namespace Thunder { | |||
namespace Exchange { | |||
|
|||
/* @json 1.0.0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can drop the annotation /* @json 1.0.0 */
on this interface and even mark it deprecated..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as per the discussion it is still required to make sure jsonrpc interfaces with backward compatible
interfaces/IMonitor.h
Outdated
|
||
using IStatisticsIterator = RPC::IIteratorType<Statistics, ID_MONITOR_STATISTICS_ITERATOR>; | ||
// @brief RestartLimits: Sets new restart limits for a plugin | ||
virtual uint32_t RestartLimits(const RestartLimitsInfo& params) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not:
virtual Core::hresult RestartLimits(const string callsign /* @index */, const RestartLimitsInfo& params) = 0;
virtual Core::hresult RestartLimits(const string callsign /* @index */, RestartLimitsInfo& params) const = 0;
so we get a property in JSON to set and get these ? and we do not need the additional struct RestartLimitsInfo and as we know have a proeprty to get the Restart limits, you can also drop the struct Statistics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
virtual uint32_t RestartLimits(const RestartLimitsInfo& params) = 0; | ||
// @brief ResetStats: Resets memory and process statistics for a single plugin watched by the Monitor | ||
virtual uint32_t ResetStats(const string& callsign, Statistics& statistics /* @out */) = 0; | ||
// @property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not reset the restartInformation, only the measurements, so suggest:
virtual Core::hresult Reset(const string& callsign, Measurements& currentMeasurements /* @out */) = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will do the reset, so I changed the interface to support only reset : virtual uint32_t Reset(const string& callsign) = 0;, the status can be retrieve with other interface Status()
RestartInfo restart /* @brief Restart limits for failures applying to the service */; | ||
}; | ||
|
||
struct EXTERNAL INotification : virtual public Core::IUnknown { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need a limited set of actions the Monitor can do, so lets create an enum for all possible actions, the Monitor can do within this interface. Than lets use the enum in the Action method below..
Do not know what the reason typically is, but I guess that might also be a very limited set, so why not turn that into an enum as well ?
We are "defining" a COMRPC interface, so I guess this interface, an INotification, needs a Register and Unregister as methods below :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IMonitor.h
Outdated
string observable /* @brief A callsign of the watched service */; | ||
RestartInfo restart /* @brief Restart limits for failures applying to the service */; | ||
}; | ||
struct ActionParams { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this whole struct can be dropped. It is used no where.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IMonitor.h
Outdated
string action /* @brief The action executed by the Monitor on a service. One of: "Activate", "Deactivate", "StoppedRestarting" */; | ||
string reason /* @brief A message describing the reason the action was taken */; | ||
}; | ||
struct RestartLimitsInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we make the methods below more strict, this structure can be dropped as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IMonitor.h
Outdated
uint64_t average /* @brief Average of all measurements */; | ||
uint64_t last /* @brief Last measured value */; | ||
}; | ||
struct Measurements { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to call this statistics as Measurement and Measurements is quite close to each other and I think we bdio not need the Statistics struct below, with more strong typed interface suggestions at the end of this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, I have kept Statistics as the name for Measurements
interfaces/IMonitor.h
Outdated
// @property | ||
// @brief Status: The memory and process statistics either for a single plugin or | ||
// all plugins watched by the Monitor | ||
virtual uint32_t Status(const string& callsign /* @index */, IStatisticsIterator*& statistics /* @out */) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit in doubt. If we want to keep it like this, it should be like:
virtual Core::hresult Status(const Core::OptionalType<string>& callsign /* @index */, IStatisticsIterator*& statistics /* @out */) const = 0;
However if you look at how this is being used:
I think the folowing interface is more suitable and does not require the struct Statistics you have today and it is more inline with a potential to reduce the buld of data moved over the line.
Suggest the following interface:
virtual Core::hresult Observables(IStringIterator*& observables /* @out */) const = 0;
virtual Core::hresult Statistics (const string& callsign /* @index */, Measurements*& statistics /* @out */) const = 0;
// if you rename Measurements to Statistics this offcourse becomes:
virtual Core::hresult Statistics (const string& callsign /* @index */, Statistics*& statistics /* @out */) const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IOCDM.h
Outdated
// @alt Drms | ||
// @property | ||
// @brief Systems - Retrieves all key systems available in the system (e.g. Nagra, PlayReady, WideVine etc) | ||
virtual Core::hresult Systems(IDrmIterator*& drms /* @out */) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this returns a list of "keySystems", so I think this should be:
virtual Core::hresult Systems(IStringIterator*& keySystems /* @out */) const = 0;
The Drm struct is not needed at all...
If it is for Backawards compatibility, just continue to use the Register("Drms")
method, as it is today with its specific code.. We can than deprecate this method and in due time drop it.
string hash /* @brief Random hash */; | ||
}; | ||
|
||
// @brief Creates Token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a security point of view, I think we do not want the Create Token to be on the JSONRPC interface. Than anyone could create any token. Security wise, I do not think this is a good idea.. Dd you find a JSON file that eposeds this interface method ?
It also looks a bit like a "dedicated" Comcast specific functionality. The creation of the token should take a BLOB. The Create TOken Process is an abstract ed metod to just sign a BLOB. Whats in the BLOB is not interesting and shoudl not be exposed on the interface by this struct..
interfaces/ISecurityAgent.h
Outdated
// @brief Creates Token | ||
virtual uint32_t CreateToken(const TokenInput& input, string& token /* @out */) = 0; | ||
// @brief Validate Token | ||
virtual uint32_t Validate(const string& token, bool& valid /* @out */) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Methods as of R4.1 should return Core::hresult :-)
interfaces/IStateControl.h
Outdated
|
||
namespace Exchange { | ||
|
||
namespace JSONRPC { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we not add the annotation /* @json */
here : https://github.com/rdkcentral/Thunder/blob/master/Source/plugins/IStateControl.h#L31
interfaces/IBrowser.h
Outdated
virtual void BridgeQuery(const string& message) = 0; | ||
// @brief Signals a state change of the Browser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is from the IStateControl interface. Is it not possible to get it from that interface, see: https://github.com/rdkcentral/Thunder/blob/master/Source/plugins/IStateControl.h#L49
interfaces/IBrowser.h
Outdated
@@ -149,6 +161,17 @@ namespace Exchange { | |||
|
|||
// @brief Initiate garbage collection | |||
virtual uint32_t CollectGarbage() = 0; | |||
// @brief Delete directory | |||
// @param path: Path to be deleted | |||
virtual uint32_t Delete(const string& path) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This on JSONRPC is not a very good option. Did you find it somewhere in *.json file ?
@@ -186,6 +186,7 @@ ENUM_CONVERSION_BEGIN(Exchange::IBrightness::Brightness) | |||
{ Exchange::IBrightness::SdrToHdrGraphicsBrightness_Max, _TXT("max") }, | |||
ENUM_CONVERSION_END(Exchange::IBrightness::Brightness) | |||
|
|||
#if ENABLE_LEGACY_INTERFACE_SUPPORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enumeration tables for enums that a part of interfaces that are tagged (at)json are (should be!) redundant here.
interfaces/IBrowser.h
Outdated
@@ -114,9 +126,9 @@ namespace Exchange { | |||
// @param fps: Current FPS | |||
virtual uint32_t FPS(uint8_t& fps /* @out */) const = 0; | |||
|
|||
/* @json:omit */ | |||
/* @json:omit @alt:deprecated */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alt is for json-rpc only but here it's omitted, it doesn't make sense together. I think what you mean is to deprecate the C++ method, i.e. mark it DEPRECATED
DEPRECATED virtual uint32_t HeaderList(string& headerlist /* @out */) const = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IBrowser.h
Outdated
@@ -149,6 +161,14 @@ namespace Exchange { | |||
|
|||
// @brief Initiate garbage collection | |||
virtual uint32_t CollectGarbage() = 0; | |||
// @property | |||
// @brief Languages: Browser prefered languages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't prepend brief with the method name, the generator already knows it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IBrowser.h
Outdated
@@ -149,6 +161,14 @@ namespace Exchange { | |||
|
|||
// @brief Initiate garbage collection | |||
virtual uint32_t CollectGarbage() = 0; | |||
// @property | |||
// @brief Languages: Browser prefered languages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't prepend brief with the method name, the generator already knows it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IMonitor.h
Outdated
virtual Core::hresult Unregister(INotification* notification) = 0; | ||
|
||
// @property | ||
// @brief RestartLimits: Set/Get new restart limits for a plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again this will look odd in the documentation, ie. no need to repeat the method name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
virtual ~IImageMetadata() override = default; | ||
|
||
struct Firmware { | ||
enum Yocto : uint8_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reconsider if we want to have the build system as an enum...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
struct AudioOutputCaps { | ||
IDeviceAudioCapabilities::AudioOutput audioOutput /* @brief Audio Output support */; | ||
IDeviceAudioCapabilities::AudioCapability audioCapabilities /* @bitmask @brief Retrieves AudioCapabilities */; | ||
IDeviceAudioCapabilities::MS12Capability ms12Capabilities /* @bitmask @brief Retrieves MS12 Capabilities */; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ms12 support is not always available, so these could be OptionalType<>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
|
||
struct Device { | ||
string deviceType /* @brief Device type */; | ||
string distributorId /* @brief Partner ID or distributor ID for device */; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these fields seem optional... distributorid, friendlyname, sku... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interfaces/IDeviceInfo.h
Outdated
|
||
string imageName /* @brief Name of firmware image */; | ||
string sdk /* @brief SDK version string */; | ||
string mediarite /* @brief Mediarite value */; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose sdk and mediarite are optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
7a79de7
to
44ef49a
Compare
44ef49a
to
c05db9f
Compare
276172d
to
78ffa9e
Compare
No description provided.