Skip to content

Commit

Permalink
Json meta to IDL changes in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul committed Nov 5, 2024
1 parent 5064240 commit 4d86f68
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 78 deletions.
2 changes: 1 addition & 1 deletion definitions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(NOT ENABLE_LEGACY_INTERFACE_SUPPORT)
"${CMAKE_SOURCE_DIR}/jsonrpc/Monitor.json"
"${CMAKE_SOURCE_DIR}/jsonrpc/OCDM.json"
"${CMAKE_SOURCE_DIR}/jsonrpc/SecurityAgent.json"
"${CMAKE_SOURCE_DIR}/jsonrpc/StateControl.json"
"${CMAKE_SOURCE_DIR}/jsonrpc/StateControl.json"
)
endif()

Expand Down
193 changes: 116 additions & 77 deletions interfaces/IDeviceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,83 +29,6 @@ namespace Exchange {
struct EXTERNAL IDeviceInfo : virtual public Core::IUnknown {
enum { ID = ID_DEVICE_INFO };

struct FirmwareInfo {
enum Yocto : uint8_t {
dunfell,
morty,
daisy,
kirkstone
};

string imageName /* @brief Name of firmware image */;
string sdk /* @brief SDK version string */;
string mediarite /* @brief Mediarite value */;
Yocto yocto /* @brief Yocto version */;
};
struct Device {
string deviceType /* @brief Device type */;
string distributorId /* @brief Partner ID or distributor ID for device */;
string friendlyName /* @brief Friendly name */;
string make /* @brief Device manufacturer */;
string modelName /* @brief Model Name */;
uint16_t modelYear /* @brief Model Year */;
string platformName /* @brief Platform name */;
string serialNumber /* Device serial number */;
string sku /* Device model number or SKU */;
};
struct System {
struct CPULoadAvgs {
uint64_t avg1min /* @brief 1min cpuload average */;
uint64_t avg5min /* @brief 5min cpuload average */;
uint64_t avg15min /* @brief 15min cpuload average */;
};
string version /* @brief Software version (in form *version#hashtag*) */;
uint64_t uptime /* @brief System uptime (in seconds) */;
uint64_t totalRAM /* @brief Total installed system RAM memory (in bytes) */;
uint64_t freeRAM /* @brief Free system RAM memory (in bytes) */;
uint64_t totalSwap /* @brief Total swap space (in bytes) */;
uint64_t freeSwap /* @brief Swap space still available (in bytes) */;
string deviceName /* @brief Host name */;
string cpuLoad /* @brief Current CPU load (percentage) */;
CPULoadAvgs cpuLoadAvg /* @brief CPU load average */;
string serialNumber /* @brief Device serial number */;
string time /* @brief Current system date and time */;
};
struct Socket {
uint32_t total /* @brief Number of total */;
uint32_t open /* @brief Number of open */;
uint32_t link /* @brief Number of link */;
uint32_t exception /* @brief Number of exception */;
uint32_t shutdown /* @brief Number of shutdown */;
uint32_t runs /* @brief Number of runs */;
};

struct Address {
string name /* @brief Interface name */;
string mac /* @brief Interface MAC address */;
string /* @opaque */ ip /* @brief An array of Interface IP address */;
};
using IAddressIterator = RPC::IIteratorType<Address, ID_DEVICE_INFO_ADDRESSES>;

// @property
// @brief Retrieves Firware Information
virtual Core::hresult FirmwareVersion(FirmwareInfo& value /* @out */) const = 0;
// @property
// @brief Retrieves Device Info
virtual Core::hresult DeviceData(Device& value /* @out */) const = 0;
// @property
// @brief Retrieves SystemInfo
virtual Core::hresult SystemInfo(System& value /* @out */) const = 0;
// @property
// @brief Retrieves SocketInfo
virtual Core::hresult SocketInfo(Socket& value /* @out */) const = 0;

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

/* @json:omit */
virtual Core::hresult Configure(const PluginHost::IShell* service) = 0;
// @property
// @brief Retrieves Serial Number
virtual Core::hresult SerialNumber(string& value /* @out */) const = 0;
Expand Down Expand Up @@ -291,5 +214,121 @@ namespace Exchange {
bool& hdr /* @out */, bool& atmos /* @out */, bool& cec /* @out */,
IVideoOutputCapsIterator*& videoOutputCaps /* @out */) const = 0;
};

/* @json 1.0.0 */
struct IDeviceMetadata : virtual Core::IUnknown {
enum { ID = ID_DEVICE_METADATA };

virtual ~IDeviceMetadata() override = default;

struct Device {
string deviceType /* @brief Device type */;
string distributorId /* @brief Partner ID or distributor ID for device */;
string friendlyName /* @brief Friendly name */;
string make /* @brief Device manufacturer */;
string modelName /* @brief Model Name */;
uint16_t modelYear /* @brief Model Year */;
string platformName /* @brief Platform name */;
string serialNumber /* Device serial number */;
string sku /* Device model number or SKU */;
};

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

/* @json 1.0.0 */
struct IImageMetadata : virtual Core::IUnknown {
enum { ID = ID_IMAGE_METADATA };

virtual ~IImageMetadata() override = default;

struct Firmware {
enum Yocto : uint8_t {
dunfell,
morty,
daisy,
kirkstone
};

string imageName /* @brief Name of firmware image */;
string sdk /* @brief SDK version string */;
string mediarite /* @brief Mediarite value */;
Yocto yocto /* @brief Yocto version */;
};

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

/* @json 1.0.0 */
struct ISystemMetadata : virtual Core::IUnknown {
enum { ID = ID_SYSTEM_METADATA };

virtual ~ISystemMetadata() override = default;

struct System {
struct CPULoadAvgs {
uint64_t avg1min /* @brief 1min cpuload average */;
uint64_t avg5min /* @brief 5min cpuload average */;
uint64_t avg15min /* @brief 15min cpuload average */;
};
string version /* @brief Software version (in form *version#hashtag*) */;
uint64_t uptime /* @brief System uptime (in seconds) */;
uint64_t totalRAM /* @brief Total installed system RAM memory (in bytes) */;
uint64_t freeRAM /* @brief Free system RAM memory (in bytes) */;
uint64_t totalSwap /* @brief Total swap space (in bytes) */;
uint64_t freeSwap /* @brief Swap space still available (in bytes) */;
string deviceName /* @brief Host name */;
string cpuLoad /* @brief Current CPU load (percentage) */;
CPULoadAvgs cpuLoadAvg /* @brief CPU load average */;
string serialNumber /* @brief Device serial number */;
string time /* @brief Current system date and time */;
};

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

/* @json 1.0.0 */
struct ISocketMetadata : virtual Core::IUnknown {
enum { ID = ID_SOCKET_METADATA };

virtual ~ISocketMetadata() override = default;

struct Socket {
uint32_t total /* @brief Number of total */;
uint32_t open /* @brief Number of open */;
uint32_t link /* @brief Number of link */;
uint32_t exception /* @brief Number of exception */;
uint32_t shutdown /* @brief Number of shutdown */;
uint32_t runs /* @brief Number of runs */;
};

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

/* @json 1.0.0 */
struct IAddressMetadata : virtual Core::IUnknown {
enum { ID = ID_ADDRESS_METADATA };

virtual ~IAddressMetadata() override = default;

struct Address {
string name /* @brief Interface name */;
string mac /* @brief Interface MAC address */;
string /* @opaque */ ip /* @brief An array of Interface IP address */;
};
using IAddressIterator = RPC::IIteratorType<Address, ID_DEVICE_INFO_ADDRESSES>;

// @brief Retrieves AddressInfo
// @param addresses: An array of Interface address
virtual Core::hresult AddressInfo(IAddressIterator*& ip /* @out */) const = 0;
};
}
}
50 changes: 50 additions & 0 deletions interfaces/IStateControl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2024 Metrological
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "Module.h"

namespace Thunder {

namespace Exchange {

namespace JSONRPC {

// @json 1.0.0
struct EXTERNAL IStateControl {

virtual ~IStateControl() = default;

enum StateType : uint8_t {
RESUMED = 0 /* @text:resumed */,
SUSPENDED = 1 /* @text:suspended */
};

// @property
// @brief State: Running state of the service
virtual Core::hresult State(StateType& state /* @out */) const = 0;
virtual Core::hresult State(const StateType state) = 0;
};

} // namespace JSONRPC

} // namespace Exchange

}
5 changes: 5 additions & 0 deletions interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ namespace Exchange {
ID_DEVICE_CAPABILITIES_AUDIO_OUTPUT = ID_DEVICE_INFO + 3,
ID_DEVICE_CAPABILITIES_VIDEO = ID_DEVICE_INFO + 4,
ID_DEVICE_CAPABILITIES_VIDEO_OUTPUT = ID_DEVICE_INFO + 5,
ID_ADDRESS_METADATA = ID_DEVICE_INFO + 6,
ID_DEVICE_METADATA = ID_DEVICE_INFO + 7,
ID_IMAGE_METADATA = ID_DEVICE_INFO + 8,
ID_SYSTEM_METADATA = ID_DEVICE_INFO + 9,
ID_SOCKET_METADATA = ID_DEVICE_INFO + 10,

ID_DIALSERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x380,
ID_DIALSERVER_APPLICATION = ID_DIALSERVER + 1,
Expand Down

0 comments on commit 4d86f68

Please sign in to comment.