Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into RDK-52316
Browse files Browse the repository at this point in the history
  • Loading branch information
npoltorapavlo committed Dec 2, 2024
2 parents 4c1a28d + 9d58337 commit a5662cf
Show file tree
Hide file tree
Showing 10 changed files with 613 additions and 1,062 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/Build ThunderInterfaces on MacOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build ThunderInterfaces on MacOS

on:
workflow_dispatch:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
Thunder_MacOS:
uses: rdkcentral/Thunder/.github/workflows/MacOS build template.yml@master

ThunderInterfaces_MacOS:
needs: Thunder_MacOS
uses: rdkcentral/ThunderInterfaces/.github/workflows/MacOS build template.yml@master

ThunderClientLibraries_MacOS:
needs: ThunderInterfaces_MacOS
uses: rdkcentral/ThunderClientLibraries/.github/workflows/MacOS build template.yml@master

ThunderNanoServices_MacOS:
needs: ThunderInterfaces_MacOS
uses: rdkcentral/ThunderNanoServices/.github/workflows/MacOS build template.yml@master

ThunderNanoServicesRDK_MacOS:
needs: ThunderInterfaces_MacOS
uses: WebPlatformForEmbedded/ThunderNanoServicesRDK/.github/workflows/MacOS build template.yml@master
80 changes: 80 additions & 0 deletions .github/workflows/MacOS build template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: MacOS build template

on:
workflow_call:

jobs:
Thunder:
runs-on: macos-14

strategy:
matrix:
build_type: [Debug, Release, MinSizeRel]

name: Build type - ${{matrix.build_type}}
steps:
# --------- Installing packages & downloading artifacts ---------
- name: Install necessary packages
run: |
brew update
brew upgrade
brew install ninja zlib
python3 -m venv venv
source venv/bin/activate
pip install jsonref
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Thunder-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}

- name: Unpack files
run: |
tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
# ----- Checkout & DependsOn regex -----
- name: Checkout ThunderInterfaces - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:') }}
uses: actions/checkout@v4
with:
path: ThunderInterfaces
repository: rdkcentral/ThunderInterfaces

- name: Regex ThunderInterfaces
if: contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:')
id: thunderinterfaces
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=\[DependsOn=ThunderInterfaces:).*(?=\])'
regex_flags: 'gim'
search_string: ${{github.event.pull_request.body}}

- name: Checkout ThunderInterfaces - ${{steps.thunderinterfaces.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:')
uses: actions/checkout@v4
with:
path: ThunderInterfaces
repository: rdkcentral/ThunderInterfaces
ref: ${{steps.thunderinterfaces.outputs.first_match}}

# ----- Building & uploading -----
- name: Build ThunderInterfaces
run: |
source venv/bin/activate
cmake -G Ninja -S ThunderInterfaces -B ${{matrix.build_type}}/build/ThunderInterfaces \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror" \
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror" \
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules"
cmake --build ${{matrix.build_type}}/build/ThunderInterfaces --target install
- name: Tar files
run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}}

- name: Upload
uses: actions/upload-artifact@v4
with:
name: ThunderInterfaces-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}.tar.gz
54 changes: 45 additions & 9 deletions definitions/Definitions.vcxproj

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion interfaces/DRMHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ class BufferReader {

// Read a value from the stream, performing endian correction,
// and advance the stream pointer.
inline bool Read1(uint8_t* v) WARNING_RESULT_NOT_USED { return Read(v); }
inline bool Read1(uint8_t* v) WARNING_RESULT_NOT_USED
{
if ((v != nullptr) && (HasBytes(1) == true)) {
*v = buf_[pos_++];
return true;
}
return false;
}
inline bool Read2(uint16_t* v) WARNING_RESULT_NOT_USED { return Read(v); }
inline bool Read2s(int16_t* v) WARNING_RESULT_NOT_USED { return Read(v); }
inline bool Read4(uint32_t* v) WARNING_RESULT_NOT_USED { return Read(v); }
Expand Down
318 changes: 314 additions & 4 deletions interfaces/IBluetooth.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions interfaces/IBluetoothAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ namespace Exchange {
// @property
// @brief Audio codecs supported by the audio sink device
// @retval ERROR_ILLEGAL_STATE The sink device currently is not connected
virtual Core::hresult SupportedCodecs(audiocodec& codecs /* @out @bitmask */) const = 0;
virtual Core::hresult SupportedCodecs(audiocodec& codecs /* @out @encode:bitmask */) const = 0;

// @property
// @brief DRM schemes supported by the audio sink device
// @retval ERROR_ILLEGAL_STATE The sink device currently is not connected
virtual Core::hresult SupportedDRMs(drmscheme& drms /* @out @bitmask */) const = 0;
virtual Core::hresult SupportedDRMs(drmscheme& drms /* @out @encode:bitmask */) const = 0;

// @property
// @brief Properites of the currently used audio codec
Expand Down
125 changes: 125 additions & 0 deletions interfaces/IUSBHub.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#pragma once

#include "Module.h"

// @stubgen:include <com/IIteratorType.h>

namespace Thunder {

namespace Exchange {

// @json
struct EXTERNAL IUSBHub : virtual public Core::IUnknown {

enum { ID = ID_USB_HUB };

~IUSBHub() override = default;

enum Speed : uint8_t {
SPEED_LOW = 1,
SPEED_FULL = 2,
SPEED_HIGH = 3,
SPEED_SUPER = 4
};

enum Flags : uint8_t {
FLAGS_AVAILABLE = 1,
FLAGS_SWITCHABLE = 2
};

enum Status : uint8_t {
STATUS_ACTIVE = 0x01,
STATUS_NO_DEVICE_CONNECTED = 0x02,
STATUS_SELF_POWERED = 0x03
};

struct ProductMetadata {
uint8_t languageId /* @brief language id present on the device */;
string serialNumber /* @brief unicode string representing the serial number of the device */;
string manufacturer /* @brief unicode string representing the manufacturer of the device */;
string product /* @brief unicode string representing the product */;
};

struct DeviceMetadata {
string deviceName /* @brief Name of the USB device */;
uint32_t parentId /* @brief Parent Node ID of the device */;
Status status /* @brief current device status */;
uint8_t deviceLevel /* @brief device level */;
uint8_t portNumber /* @brief port number of USB on which the device is attached */;
uint8_t protocol /* @brief Protocol supported by the device */;
Speed busSpeed /* @brief Speed of the device */;
string serialNumber /* @brief Serial number of the device */;
Flags flags /* @brief Flags of the device */;
uint16_t vendorId /* @brief the vendor Id assigned to this device */;
uint16_t productId /* @brief the product Id assigned to this device */;
uint8_t deviceClass /* @brief USB class of the device as per USB specificiation */ ;
uint8_t deviceSubclass /* @brief USB sub class of the device as per USB specificiation */;
string devicePath /* @brief the path to be used for the USB device ex: /dev/sdX */;
uint32_t features /* @brief Features supported by the device - reserved */;
uint8_t numLanguageIds /* @brief number of language ids present on the device */;
ProductMetadata productInfo1;
ProductMetadata productInfo2;
ProductMetadata productInfo3;
ProductMetadata productInfo4;
};

using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;

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

~INotification() override = default;

// @brief Device Plugged in on the bus notification
// @param device: USB information of the plugged in device
virtual void Announce(const DeviceMetadata& device) = 0;

// @brief Device removed from the bus notification
// @param device: USB information of the plugged in device
virtual void Revoke(const DeviceMetadata& device) = 0;
};

struct EXTERNAL IDevice : virtual public Core::IUnknown {

enum { ID = ID_USB_DEVICE };

~IDevice() override = default;
};

/** Register notification interface */
virtual Core::hresult Register(INotification *notification) = 0;

/** Unregister notification interface */
virtual Core::hresult Unregister(const INotification *notification) = 0;

// @brief Get a string array defning al devices hooked up to this hub.
// @param iterator : List of USB devices (deviceName).
virtual Core::hresult Devices(IStringIterator*& iterator /* @out */) const = 0;

// @brief Get a string array defining all devices hooked up to this hub cmpliant to the given VendorId/ProductId
// @param iterator : List of USB devices (deviceName).
virtual Core::hresult VendorDevices(const uint16_t vendorId, const uint16_t productId, IStringIterator*& iterator /* @out */) const = 0;

/** Gets the device metadata of a connected USB Devices.*/
// @brief Get the metadata information about the name passed in the paramater.
// @param deviceName: Name of the device
// @param device: all the metadata of the requested deviceName device.
virtual Core::hresult Device(const string& deviceName, struct DeviceMetadata& device /* @out */ ) const = 0;

// @brief Acquire the respective driver for the device */
// @param deviceName: Name of the device
// @param device: interface to access the device.
/* @json:omit */
virtual Core::hresult Acquire(const string& deviceName /* @in */, IDevice*& device /* @out */ ) const = 0;

// @brief Relinquish the respective driver for the device */
// @param device: Device to be released
/* @json:omit */
virtual Core::hresult Relinquish(const IDevice*& device /* @out */) const = 0;
};

} // namespace Exchange

} // namespace Thunder

10 changes: 5 additions & 5 deletions interfaces/IWifiControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace Exchange {
WPA_WPA2 = 0x40 /* @text: WPA_WPA2 */,
UNKNOWN = 0x00
};

struct SecurityInfo {
enum Key : uint8_t {
PSK = 0x01 /* @text: PSK */,
Expand All @@ -52,18 +52,18 @@ namespace Exchange {
PSK_HASHED = 0x80 /* @text: PSK_HASHED */,
NONE = 0x00
};

Security method /* @brief Security method */;
Key keys /* @bitmask @brief Security Keys */;
};
Key keys /* @encode:bitmask @brief Security Keys */;
};
using ISecurityIterator = RPC::IIteratorType<SecurityInfo, ID_WIFICONTROL_SECURITY_INFO_ITERATOR>;

struct NetworkInfo {
string ssid /* @brief SSID of the network */;
uint64_t bssid /* @brief BSSID of the network */;
uint32_t frequency /* @brief Frequency used */;
int32_t signal /* @brief Signal strength */;
Security security /* @bitmask @brief Security method */;
Security security /* @encode:bitmask @brief Security method */;
};
using INetworkInfoIterator = RPC::IIteratorType<NetworkInfo, ID_WIFICONTROL_NETWORK_INFO_ITERATOR>;
using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;
Expand Down
8 changes: 6 additions & 2 deletions interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,13 @@ namespace Exchange {
ID_DNS_ZONE = ID_DNS_SERVER + 1,
ID_DNS_RECORD = ID_DNS_SERVER + 2,

ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0,
ID_USB_HUB = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0,
ID_USB_HUB_NOTIFICATION = ID_USB_HUB + 1,
ID_USB_DEVICE = ID_USB_HUB + 2,

ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x9F0,
ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1,
ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2,
ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2

ID_CONTENTPROTECTION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500,
ID_CONTENTPROTECTION_NOTIFICATION = ID_CONTENTPROTECTION + 1,
Expand Down
Loading

0 comments on commit a5662cf

Please sign in to comment.