mirror of
https://github.com/Evolution-X-Devices/device_google_wahoo
synced 2026-02-01 07:50:47 +00:00
Define OffloadServer class that implements the Offload HAL service and the callback interface to the CHRE platform. This is where the communication to the CHRE interface will take place and this class is created to be testable for unit testing. Bug: 32842314 Test: VTS Change-Id: I9c259ab2b721d7d1ac8cb16083c464002c237a16
58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
#ifndef WIFI_OFFLOAD_SERVER_H_
|
|
#define WIFI_OFFLOAD_SERVER_H_
|
|
|
|
#include <android/hardware/wifi/offload/1.0/IOffload.h>
|
|
|
|
#include "chre_interface_callbacks.h"
|
|
|
|
namespace android {
|
|
namespace hardware {
|
|
namespace wifi {
|
|
namespace offload {
|
|
namespace V1_0 {
|
|
namespace implementation {
|
|
|
|
class OffloadServer;
|
|
|
|
class ChreInterfaceCallbacksImpl : public ChreInterfaceCallbacks {
|
|
public:
|
|
ChreInterfaceCallbacksImpl(OffloadServer* server);
|
|
~ChreInterfaceCallbacksImpl() override;
|
|
|
|
void handleConnectionEvents(ChreInterfaceCallbacks::ConnectionEvent event);
|
|
void handleMessage(uint32_t messageType, const std::vector<uint8_t>& message);
|
|
|
|
private:
|
|
OffloadServer* mServer;
|
|
};
|
|
|
|
/**
|
|
* Interface object to communicate with Offload HAL
|
|
*/
|
|
class OffloadServer {
|
|
public:
|
|
OffloadServer();
|
|
|
|
bool configureScans(const ScanParam& param, const ScanFilter& filter);
|
|
std::pair<ScanStats, bool> getScanStats();
|
|
bool subscribeScanResults(uint32_t delayMs);
|
|
bool unsubscribeScanResults();
|
|
bool setEventCallback(const sp<IOffloadCallback>& cb);
|
|
|
|
private:
|
|
ScanStats mScanStats;
|
|
std::unique_ptr<ChreInterfaceCallbacksImpl> mChreInterfaceCallbacks;
|
|
sp<IOffloadCallback> mEventCallback;
|
|
|
|
friend class ChreInterfaceCallbacksImpl;
|
|
};
|
|
|
|
} // namespace implementation
|
|
} // namespace V1_0
|
|
} // namespace offload
|
|
} // namespace wifi
|
|
} // namespace hardware
|
|
} // namespace android
|
|
|
|
#endif // WIFI_OFFLOAD_SERVER_H_
|