ap_interface_binder.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (C) 2016 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef WIFICOND_AP_INTERFACE_BINDER_H_
  17. #define WIFICOND_AP_INTERFACE_BINDER_H_
  18. #include <android-base/macros.h>
  19. #include "wificond/net/netlink_manager.h"
  20. #include "android/net/wifi/BnApInterface.h"
  21. #include "android/net/wifi/IApInterfaceEventCallback.h"
  22. namespace android {
  23. namespace wificond {
  24. class ApInterfaceImpl;
  25. class ApInterfaceBinder : public android::net::wifi::BnApInterface {
  26. public:
  27. explicit ApInterfaceBinder(ApInterfaceImpl* impl);
  28. ~ApInterfaceBinder() override;
  29. // Called by |impl_| on its destruction.
  30. // This informs the binder proxy that no future manipulations of |impl_|
  31. // by remote processes are possible.
  32. void NotifyImplDead() { impl_ = nullptr; }
  33. // Called by |impl_| everytime number of associated stations changes.
  34. void NotifyNumAssociatedStationsChanged(int num_stations);
  35. // Called by |impl_| on every channel switch event.
  36. void NotifySoftApChannelSwitched(int frequency,
  37. ChannelBandwidth channel_bandwidth);
  38. binder::Status registerCallback(
  39. const sp<net::wifi::IApInterfaceEventCallback>& callback,
  40. bool* out_success) override;
  41. binder::Status getInterfaceName(std::string* out_name) override;
  42. binder::Status getNumberOfAssociatedStations(
  43. int* out_num_of_stations) override;
  44. private:
  45. ApInterfaceImpl* impl_;
  46. android::sp<net::wifi::IApInterfaceEventCallback>
  47. ap_interface_event_callback_;
  48. DISALLOW_COPY_AND_ASSIGN(ApInterfaceBinder);
  49. };
  50. } // namespace wificond
  51. } // namespace android
  52. #endif // WIFICOND_AP_INTERFACE_BINDER_H_