Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
294 changes: 294 additions & 0 deletions apis/ApplicationManager/IApplicationService.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
//
// IApplicationService.h
// Thunder RPC interface definitions for AS Services
// Uses Thunder header-based code generation approach
//
// USAGE:
// Run Thunder ProxyStubGenerator or JsonGenerator on this file to generate:
// - JSON-RPC proxy classes (client-side for asproxy)
// - JSON-RPC stub registration (server-side for services)
// - Marshalling/unmarshalling code
//

#pragma once

#include "Module.h"
Comment on lines +1 to +15
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The file header is missing the standard Apache 2.0 copyright/license block that other apis/**/I*.h interface headers include. Please add the repository-standard license header at the top of this new API file for consistency and compliance.

Copilot uses AI. Check for mistakes.

namespace WPEFramework
{
namespace Exchange
{

// @json 1.0.0 @text:keep
// @brief Request interface for HTTP-style requests
// This interface handles GET/POST/DELETE requests similar to HTTP REST APIs
struct EXTERNAL IApplicationServiceRequest : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_REQUEST
};

// @brief Process an HTTP-style request
// @param flags Request type flags: GET=0x01, POST=0x02, DELETE=0x04
// @param url Request URL path (e.g., "/as/network/ipconfig/settings")
// @param headers HTTP headers as JSON object string
// @param queryParams Query parameters as JSON object string
// @param body Request body (for POST requests)
// @param code HTTP status code (output)
// @param responseHeaders Response headers as JSON object string (output)
// @param responseBody Response body as JSON string (output)
// @return Error code: ERROR_NONE on success
// @text:request
Comment on lines +32 to +42
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

Method documentation uses @return prose but is missing the required @retval <ErrorCode>: <Description> annotations. Please add explicit @retval entries for each possible return value for these APIs (e.g., success and common error cases), as required for generated docs.

Refer: https://github.com/rdkcentral/entservices-apis/blob/develop/.github/instructions/api_headers.instructions.md#documentation-tags-guidelines

Copilot uses AI. Check for mistakes.
virtual Core::hresult Request(
Comment on lines +41 to +43
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The @text tag syntax is inconsistent with the project’s interface-header guidelines/examples (which use // @text <name> with a space). Using // @text:<name> may not be recognized by the documentation/code generators. Please switch these to the documented form (e.g., // @text request, // @text getSystemInfo, etc.).

Refer: https://github.com/rdkcentral/entservices-apis/blob/develop/.github/instructions/api_headers_methods.instructions.md#api--notification-naming-for-interface-and-json-rpc

Copilot generated this review using guidance from repository custom instructions.
const uint32_t flags,
Comment on lines +32 to +44
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

flags encodes a small, well-known set of request types (GET/POST/DELETE) but is exposed as a raw uint32_t. Per the interface guidelines, prefer an enum/bitmask enum for constrained values to make the API self-describing and type-safe (and to avoid undocumented flag combinations).

Refer: https://github.com/rdkcentral/entservices-apis/blob/develop/.github/instructions/api_headers_methods.instructions.md#special-considerations-for-enum-and-string-parameters

Suggested change
// @brief Process an HTTP-style request
// @param flags Request type flags: GET=0x01, POST=0x02, DELETE=0x04
// @param url Request URL path (e.g., "/as/network/ipconfig/settings")
// @param headers HTTP headers as JSON object string
// @param queryParams Query parameters as JSON object string
// @param body Request body (for POST requests)
// @param code HTTP status code (output)
// @param responseHeaders Response headers as JSON object string (output)
// @param responseBody Response body as JSON string (output)
// @return Error code: ERROR_NONE on success
// @text:request
virtual Core::hresult Request(
const uint32_t flags,
enum REQUEST_FLAGS : uint32_t {
REQUEST_GET = 0x01 /* @text REQUEST_GET */,
REQUEST_POST = 0x02 /* @text REQUEST_POST */,
REQUEST_DELETE = 0x04 /* @text REQUEST_DELETE */
};
// @brief Process an HTTP-style request
// @param flags Request type flags. Bitmask of REQUEST_FLAGS (e.g., REQUEST_GET, REQUEST_POST, REQUEST_DELETE)
// @param url Request URL path (e.g., "/as/network/ipconfig/settings")
// @param headers HTTP headers as JSON object string
// @param queryParams Query parameters as JSON object string
// @param body Request body as JSON string (typically used for POST requests)
// @param code HTTP status code (output)
// @param responseHeaders Response headers as JSON object string (output)
// @param responseBody Response body as JSON string (output)
// @retval Core::ERROR_NONE: Request processed successfully
// @retval Core::ERROR_GENERAL: Request processing failed
// @text:request
virtual Core::hresult Request(
const REQUEST_FLAGS flags,

Copilot uses AI. Check for mistakes.
const string &url,
const string &headers,
const string &queryParams,
const string &body,
uint32_t &code /* @out */,
string &responseHeaders /* @out */,
string &responseBody /* @out */) = 0;
};

// @json 1.0.0 @text:keep
// @brief Configuration interface
// Returns service configuration JSON
struct EXTERNAL IApplicationServiceConfig : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_CONFIG
};

// @brief Get service configuration
// @param config Service configuration as JSON string (output)
// @return Error code: ERROR_NONE on success
// @text:config
virtual Core::hresult Config(string &config /* @out */) = 0;
};

// @json 1.0.0 @text:keep
// @brief Listener registration interface
// Manages WebSocket, Updates, and System Status listeners
struct EXTERNAL IApplicationServiceListener : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_LISTENER
};

// @brief Register WebSocket listener
// @param url WebSocket URL to monitor
// @param clientId Client identifier
// @param listenerId Generated listener ID (output)
// @return Error code: ERROR_NONE on success
// @text:registerWebSocketListener
virtual Core::hresult RegisterWebSocketListener(
const string &url,
const string &clientId,
string &listenerId /* @out */) = 0;

// @brief Unregister WebSocket listener
// @param listenerId Listener ID to unregister
// @return Error code: ERROR_NONE on success
// @text:unregisterWebSocketListener
virtual Core::hresult UnregisterWebSocketListener(
const string &listenerId) = 0;

// @brief Register Updates listener
// @param url URL to monitor for updates
// @param clientId Client identifier
// @param listenerId Generated listener ID (output)
// @return Error code: ERROR_NONE on success
// @text:registerUpdatesListener
virtual Core::hresult RegisterUpdatesListener(
const string &url,
const string &clientId,
string &listenerId /* @out */) = 0;

// @brief Unregister Updates listener
// @param listenerId Listener ID to unregister
// @return Error code: ERROR_NONE on success
// @text:unregisterUpdatesListener
virtual Core::hresult UnregisterUpdatesListener(
const string &listenerId) = 0;

// @brief Register System Status listener
// @param clientId Client identifier
// @param listenerId Generated listener ID (output)
// @return Error code: ERROR_NONE on success
// @text:registerSysStatusListener
virtual Core::hresult RegisterSysStatusListener(
const string &clientId,
string &listenerId /* @out */) = 0;

// @brief Unregister System Status listener
// @param listenerId Listener ID to unregister
// @return Error code: ERROR_NONE on success
// @text:unregisterSysStatusListener
virtual Core::hresult UnregisterSysStatusListener(
const string &listenerId) = 0;

// @event
struct EXTERNAL INotification : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_LISTENER_NOTIFICATION
};

// @brief WebSocket update notification
// @param url WebSocket URL that sent update
// @param message Update message content
// @text:onNotifyWebSocketUpdate
virtual void OnNotifyWebSocketUpdate(const string &url, const string &message) = 0;

Comment on lines +141 to +146
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

IApplicationServiceListener::INotification defines notification methods as pure virtual (= 0). Notification interfaces in these API headers must provide default (empty) implementations and must not use pure virtual methods, to keep implementation and binary compatibility expectations consistent.

Refer: https://github.com/rdkcentral/entservices-apis/blob/develop/.github/instructions/api_headers_notifications.instructions.md#notification-interfaces

Copilot generated this review using guidance from repository custom instructions.
// @brief HTTP update notification
// @param url HTTP endpoint that sent update
// @param code HTTP status code
// @text:onNotifyHttpUpdate
virtual void OnNotifyHttpUpdate(const string &url, const uint32_t code) = 0;
Comment on lines +141 to +151
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

Notification naming doesn’t follow the documented on[Object][Action] pattern. For example, OnNotifyWebSocketUpdate / @text:onNotifyWebSocketUpdate uses an extra “Notify” prefix that makes the object/action unclear. Please rename notifications (and their @text names) to match the pattern (e.g., OnWebSocketUpdate with // @text onWebSocketUpdate).

Refer: https://github.com/rdkcentral/entservices-apis/blob/develop/.github/instructions/api_headers_notifications.instructions.md#notification-name-formatting

Copilot generated this review using guidance from repository custom instructions.

// @brief System status update notification
// @param status Status message as JSON string
// @text:onNotifySysStatusUpdate
virtual void OnNotifySysStatusUpdate(const string &status) = 0;
};
virtual Core::hresult Register(IApplicationServiceListener::INotification *notification) = 0;
Comment on lines +157 to +158
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

Register / Unregister are missing the required interface documentation tags (@brief, @param, and (where applicable) @retval). Please document these methods consistently so the generated API docs are complete.

Refer: https://github.com/rdkcentral/entservices-apis/blob/develop/.github/instructions/api_headers.instructions.md#documentation-tags-guidelines

Suggested change
};
virtual Core::hresult Register(IApplicationServiceListener::INotification *notification) = 0;
};
// @brief Register a notification sink for application service listener events.
// @param notification Pointer to the notification interface instance to be registered.
// @retval Core::ERROR_NONE: Registration succeeded.
// @retval Core::ERROR_BAD_REQUEST: The notification parameter is null or invalid.
// @retval Core::ERROR_ALREADY_CONNECTED: The notification interface is already registered.
// @text register
virtual Core::hresult Register(IApplicationServiceListener::INotification *notification) = 0;
// @brief Unregister a previously registered notification sink.
// @param notification Pointer to the notification interface instance to be unregistered.
// @retval Core::ERROR_NONE: Unregistration succeeded.
// @retval Core::ERROR_BAD_REQUEST: The notification parameter is null or invalid.
// @retval Core::ERROR_UNKNOWN_KEY: The specified notification interface is not currently registered.
// @text unregister

Copilot uses AI. Check for mistakes.
virtual Core::hresult Unregister(IApplicationServiceListener::INotification *notification) = 0;
};

// @json 1.0.0 @text:keep
// @brief System information interface
// Returns aggregated system information from all services
struct EXTERNAL IApplicationServiceSystemInfo : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_SYSTEMINFO
};

// @brief Get system information
// @param info System information as JSON string (output)
// @return Error code: ERROR_NONE on success
// @text:getSystemInfo
virtual Core::hresult GetSystemInfo(string &info /* @out */) = 0;
};

// @json 1.0.0 @text:keep
// @brief System settings interface
// Get/Set system-wide settings
struct EXTERNAL IApplicationServiceSystemSettings : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_SYSTEMSETTINGS
};

// @brief Get system setting value
// @param name Setting name
// @param value Setting value (output)
// @return Error code: ERROR_NONE on success, ERROR_UNKNOWN_KEY if not found
// @text:getSystemSetting
virtual Core::hresult GetSystemSetting(
const string &name,
string &value /* @out */) = 0;

// @brief Set system setting value
// @param name Setting name
// @param value Setting value
// @return Error code: ERROR_NONE on success
// @text:setSystemSetting
virtual Core::hresult SetSystemSetting(
const string &name,
const string &value) = 0;
};

// @json 1.0.0 @text:keep
// @brief Test preferences interface
// Get/Set test preferences (requires PIN for set operations)
struct EXTERNAL IApplicationServiceTestPreferences : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_TESTPREFS
};

// @brief Get test preference value
// @param name Preference name
// @param value Preference value (output)
// @return Error code: ERROR_NONE on success, ERROR_UNKNOWN_KEY if not found
// @text:getTestPreference
virtual Core::hresult GetTestPreference(
const string &name,
string &value /* @out */) = 0;

// @brief Set test preference value
// @param name Preference name
// @param value Preference value
// @param pin Security PIN
// @return Error code: ERROR_NONE on success, ERROR_PRIVILEGED_REQUEST if PIN invalid
// @text:setTestPreference
virtual Core::hresult SetTestPreference(
const string &name,
const string &value,
const uint32_t pin) = 0;
};

// @json 1.0.0 @text:keep
// @brief Diagnostics interface
// Get/Set diagnostic logging contexts
struct EXTERNAL IApplicationServiceDiagnostics : virtual public Core::IUnknown
{
enum
{
ID = ID_APPLICATION_SERVICE_DIAGNOSTICS
};

// @brief Get diagnostic contexts
// @param contexts Diagnostic contexts as JSON string (output)
// @return Error code: ERROR_NONE on success
// @text:getDiagContexts
virtual Core::hresult GetDiagContexts(string &contexts /* @out */) = 0;

// @brief Set diagnostic contexts
// @param contexts Diagnostic contexts as JSON string
// @param updated Number of contexts updated (output)
// @return Error code: ERROR_NONE on success
// @text:setDiagContexts
virtual Core::hresult SetDiagContexts(
const string &contexts,
uint32_t &updated /* @out */) = 0;

// @brief Test/Debug: Trigger WebSocket event manually
// @param url Event URL
// @param message Event message
// @return Error code: ERROR_NONE on success
// @text:testTriggerWebSocketEvent
virtual Core::hresult TestTriggerWebSocketEvent(
const string &url,
const string &message) = 0;

// @brief Test/Debug: Trigger HTTP event manually
// @param url Event URL
// @param code HTTP status code
// @return Error code: ERROR_NONE on success
// @text:testTriggerHttpEvent
virtual Core::hresult TestTriggerHttpEvent(
const string &url,
uint32_t code) = 0;

// @brief Test/Debug: Trigger System Status event manually
// @param status Status message
// @return Error code: ERROR_NONE on success
// @text:testTriggerSysStatusEvent
virtual Core::hresult TestTriggerSysStatusEvent(
const string &status) = 0;
};

} // namespace Exchange
} // namespace WPEFramework

// NOTE: Backward compatibility helpers have been moved to ASServiceThunderHelpers.h
// Include that header if you need RequestParams, RequestResult, or convenience type aliases.
11 changes: 11 additions & 0 deletions apis/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,17 @@ namespace Exchange {
ID_GOOGLE_CAST_RM_DELEGATE_NOTIFICATION = ID_GOOGLE_CAST + 3,

ID_RESOURCEMANAGER = ID_ENTOS_OFFSET + 0x480,

ID_APPLICATION_SERVICE_REQUEST = ID_ENTOS_OFFSET + 0x490,
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

Indentation within the newly added ID block is inconsistent (ID_APPLICATION_SERVICE_REQUEST is tab-indented while the following lines are space-indented). Please normalize indentation in this block to match the surrounding style to keep diffs clean.

Suggested change
ID_APPLICATION_SERVICE_REQUEST = ID_ENTOS_OFFSET + 0x490,
ID_APPLICATION_SERVICE_REQUEST = ID_ENTOS_OFFSET + 0x490,

Copilot uses AI. Check for mistakes.
ID_APPLICATION_SERVICE_CONFIG = ID_APPLICATION_SERVICE_REQUEST + 1,
ID_APPLICATION_SERVICE_LISTENER = ID_APPLICATION_SERVICE_REQUEST + 2,
ID_APPLICATION_SERVICE_LISTENER_NOTIFICATION = ID_APPLICATION_SERVICE_REQUEST + 3,
ID_APPLICATION_SERVICE_SYSTEMINFO = ID_APPLICATION_SERVICE_REQUEST + 4,
ID_APPLICATION_SERVICE_SYSTEMSETTINGS = ID_APPLICATION_SERVICE_REQUEST + 5,
ID_APPLICATION_SERVICE_TESTPREFS = ID_APPLICATION_SERVICE_REQUEST + 6,
ID_APPLICATION_SERVICE_DIAGNOSTICS = ID_APPLICATION_SERVICE_REQUEST + 7,


}; // enum IDS

} // namespace Exchange
Expand Down
Loading