Skip to content

Commit

Permalink
[IPackager] Update with JSON-RPC interface (#412)
Browse files Browse the repository at this point in the history
* Adjust IPackager to use JSON-RPC, remove .json file

* Add IPackager to definition on Windows

* Remove Packager from defitions

* Added DEPRECATED to the Configure() method

* Update params to be present in the md
  • Loading branch information
VeithMetro authored Feb 11, 2025
1 parent 0a4746d commit 86df6c9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 75 deletions.
4 changes: 0 additions & 4 deletions definitions/Definitions.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<ClCompile Include="..\interfaces\json\JsonEnum_Netflix.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_NetworkControl.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_OCDM.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_Packager.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_PerformanceMonitor.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_Power.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_Provisioning.cpp" />
Expand Down Expand Up @@ -324,9 +323,6 @@
<CustomBuild Include="..\jsonrpc\OCDM.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\Packager.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\PerformanceMonitor.json">
<FileType>Document</FileType>
</CustomBuild>
Expand Down
6 changes: 0 additions & 6 deletions definitions/Definitions.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@
<ClCompile Include="..\interfaces\json\JsonEnum_OCDM.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_Packager.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_PerformanceMonitor.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -213,9 +210,6 @@
<CustomBuild Include="..\jsonrpc\OCDM.json">
<Filter>Contracts</Filter>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\Packager.json">
<Filter>Contracts</Filter>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\PerformanceMonitor.json">
<Filter>Contracts</Filter>
</CustomBuild>
Expand Down
22 changes: 19 additions & 3 deletions interfaces/IPackager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
namespace Thunder {
namespace Exchange {

// @json 1.0.0 @text:legacy_lowercase
struct EXTERNAL IPackager : virtual public Core::IUnknown {
enum { ID = ID_PACKAGER };

Expand All @@ -49,7 +50,7 @@ namespace Exchange {
enum { ID = ID_PACKAGER_INSTALLATIONINFO };
virtual state State() const = 0;
virtual uint8_t Progress() const = 0;
virtual string AppName() const = 0;
virtual string AppName() const = 0;
virtual uint32_t ErrorCode() const = 0;
virtual uint32_t Abort() = 0;
};
Expand All @@ -67,10 +68,25 @@ namespace Exchange {
virtual void RepositorySynchronize(uint32_t status) = 0;
};

// @json:omit
virtual void Register(INotification* observer) = 0;
// @json:omit
virtual void Unregister(const INotification* observer) = 0;
virtual uint32_t Configure(PluginHost::IShell* service) = 0;
virtual uint32_t Install(const string& name, const string& version, const string& arch) = 0;
// @json:omit
DEPRECATED virtual uint32_t Configure(PluginHost::IShell* service) = 0;

// @brief Install a package given by a name, an URL or a file path
// @param name: Name, URL or file path of the package to install (e.g. thunder-plugin-netflix)
// @param version: Version of the package to install (e.g. 1.0)
// @param arch: Architecture of the package to install (e.g. arm)
// @retval ERROR_INPROGRESS Other installation/synchronization is already in progress
// @retval ERROR_GENERAL Opkg package manager not initialized successfully
virtual uint32_t Install(const string& name, const string& version /* @opptional */, const string& arch /* @opptional */) = 0;

// @brief Synchronize repository manifest with a repository
// @alt::deprecated synchronize
// @retval ERROR_INPROGRESS Other installation/synchronization is already in progress
// @retval ERROR_GENERAL Opkg package manager not initialized successfully
virtual uint32_t SynchronizeRepository() = 0;
};
}
Expand Down
62 changes: 0 additions & 62 deletions jsonrpc/Packager.json

This file was deleted.

0 comments on commit 86df6c9

Please sign in to comment.