Userspace Resource Manager
Loading...
Searching...
No Matches
Relay.cpp

Sample Usage of Resource Tuner's Relay Signal API.

Sample Usage of Resource Tuner's Relay Signal API.

// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-3-Clause
#include <iostream>
extern "C" void initFeature() {
// Use this function for initialization
}
extern "C" void tearFeature() {
// Use this function for cleanup
}
extern "C" void relayFeature(uint32_t signalCode,
std::string& mAppName,
std::string& mScenario,
int32_t mNumArgs,
std::vector<uint32_t>* mListArgs) {
// This function will be called when a relaySignal request is called for any Signal
// which is subscribed to this feature.
// For example:
// signal | features
// s1 | f1, f2, f5
// s2 | f5, f7, f8
// s3 | f9, f10
// When a relaySignal API request is received for s2, it will be relayed (forwarded) to
// features: f5, f7 and f8.
}
/*
* Compilation Notes:
* => Create the shared lib:
* "g++ -fPIC -shared -o libRelay.so Relay.cpp"
* This creates a shared lib, libRelay.so
* => This lib can have any name and can be placed in any location, the full path to the lib
* needs to be specified in the ExtFeaturesConfig.yaml file.
* => Make sure the lib file has appropriate permissions:
* "sudo chmod o+r <path_to_lib>"
*/