1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef BATCHING_API_CLINET_H
- #define BATCHING_API_CLINET_H
- #include <mutex>
- #include <android/hardware/gnss/1.0/IGnssBatching.h>
- #include <android/hardware/gnss/1.0/IGnssBatchingCallback.h>
- #include <pthread.h>
- #include <LocationAPIClientBase.h>
- namespace android {
- namespace hardware {
- namespace gnss {
- namespace V1_1 {
- namespace implementation {
- class BatchingAPIClient : public LocationAPIClientBase
- {
- public:
- BatchingAPIClient(const sp<V1_0::IGnssBatchingCallback>& callback);
- void gnssUpdateCallbacks(const sp<V1_0::IGnssBatchingCallback>& callback);
- int getBatchSize();
- int startSession(const V1_0::IGnssBatching::Options& options);
- int updateSessionOptions(const V1_0::IGnssBatching::Options& options);
- int stopSession();
- void getBatchedLocation(int last_n_locations);
- void flushBatchedLocations();
- inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; }
-
- void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
- void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final;
- private:
- ~BatchingAPIClient();
- std::mutex mMutex;
- sp<V1_0::IGnssBatchingCallback> mGnssBatchingCbIface;
- uint32_t mDefaultId;
- LocationCapabilitiesMask mLocationCapabilitiesMask;
- };
- }
- }
- }
- }
- }
- #endif
|