-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into RDK-52316
- Loading branch information
Showing
10 changed files
with
613 additions
and
1,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.