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

Json meta to IDL changes #394

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

HaseenaSainul
Copy link
Contributor

No description provided.

@@ -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)
Copy link
Collaborator

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..

Copy link
Contributor Author

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

@HaseenaSainul HaseenaSainul force-pushed the development/METROL-1071 branch 2 times, most recently from 4d86f68 to 8c69e90 Compare November 6, 2024 10:00

// @property
// @brief Retrieves Device Info
virtual Core::hresult DeviceData(Device& device /* @out */) const = 0;
Copy link
Collaborator

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;


// @property
// @brief Retrieves Firware Information
virtual Core::hresult FirmwareInfo(Firmware& firmware /* @out */) const = 0;
Copy link
Collaborator

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


// @property
// @brief Retrieves SystemInfo
virtual Core::hresult SystemInfo(System& system /* @out */) const = 0;
Copy link
Collaborator

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


// @property
// @brief Retrieves SocketInfo
virtual Core::hresult SocketInfo(Socket& socket /* @out */) const = 0;
Copy link
Collaborator

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// @property
// @brief Retrieves AddressInfo
// @param addresses: An array of Interface address
virtual Core::hresult AddressInfo(IAddressIterator*& ip /* @out */) const = 0;
Copy link
Collaborator

@pwielders pwielders Nov 6, 2024

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -25,136 +25,315 @@

namespace Thunder {
namespace Exchange {

/* @json 1.0.0 */
Copy link
Collaborator

@pwielders pwielders Nov 6, 2024

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..

Copy link
Contributor Author

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

// @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;
Copy link
Collaborator

@pwielders pwielders Nov 6, 2024

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
Copy link
Collaborator

@pwielders pwielders Nov 6, 2024

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..

// @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;
Copy link
Collaborator

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 :-)


namespace Exchange {

namespace JSONRPC {
Copy link
Collaborator

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

virtual void BridgeQuery(const string& message) = 0;
// @brief Signals a state change of the Browser
Copy link
Collaborator

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

@@ -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;
Copy link
Collaborator

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 ?

@sebaszm sebaszm self-requested a review November 8, 2024 10:20
@@ -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
Copy link
Contributor

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.

@@ -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 */
Copy link
Contributor

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -149,6 +161,14 @@ namespace Exchange {

// @brief Initiate garbage collection
virtual uint32_t CollectGarbage() = 0;
// @property
// @brief Languages: Browser prefered languages
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -149,6 +161,14 @@ namespace Exchange {

// @brief Initiate garbage collection
virtual uint32_t CollectGarbage() = 0;
// @property
// @brief Languages: Browser prefered languages
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

virtual ~IImageMetadata() override = default;

struct Firmware {
enum Yocto : uint8_t {
Copy link
Contributor

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

struct AudioOutputCaps {
IDeviceAudioCapabilities::AudioOutput audioOutput /* @brief Audio Output support */;
IDeviceAudioCapabilities::AudioCapability audioCapabilities /* @bitmask @brief Retrieves AudioCapabilities */;
IDeviceAudioCapabilities::MS12Capability ms12Capabilities /* @bitmask @brief Retrieves MS12 Capabilities */;
Copy link
Contributor

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<>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


struct Device {
string deviceType /* @brief Device type */;
string distributorId /* @brief Partner ID or distributor ID for device */;
Copy link
Contributor

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... ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


string imageName /* @brief Name of firmware image */;
string sdk /* @brief SDK version string */;
string mediarite /* @brief Mediarite value */;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@HaseenaSainul HaseenaSainul force-pushed the development/METROL-1071 branch from 7a79de7 to 44ef49a Compare November 8, 2024 12:03
@HaseenaSainul HaseenaSainul force-pushed the development/METROL-1071 branch from 44ef49a to c05db9f Compare November 20, 2024 08:51
@HaseenaSainul HaseenaSainul force-pushed the development/METROL-1071 branch from 276172d to 78ffa9e Compare November 28, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants