Files
device_google_wahoo/wifi_offload/offload_server.h
Sohani Rao 2724a99e3c Offload HAL Service: Invoke Server implementation
Offload HAL service implementation to invoke the OffloadServer API.

Bug: 32842314
Test: VTS
Change-Id: Iacb77317cc6bdcc453a93e395403cb649eab28b4
2017-05-23 18:36:11 -07:00

59 lines
1.5 KiB
C++

#ifndef WIFI_OFFLOAD_SERVER_H_
#define WIFI_OFFLOAD_SERVER_H_
#include <android/hardware/wifi/offload/1.0/IOffload.h>
#include "chre_interface_factory.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(ChreInterfaceFactory* factory);
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;
std::unique_ptr<ChreInterface> mChreInterface;
sp<IOffloadCallback> mEventCallback;
friend class ChreInterfaceCallbacksImpl;
};
} // namespace implementation
} // namespace V1_0
} // namespace offload
} // namespace wifi
} // namespace hardware
} // namespace android
#endif // WIFI_OFFLOAD_SERVER_H_