it3256.h 874 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IT3256_H
  2. #define IT3256_H
  3. #include <map>
  4. #include <mutex>
  5. #include <thread>
  6. #include "iit3256.h"
  7. #include "it3256_death_recipient.h"
  8. namespace OHOS {
  9. namespace It3256 {
  10. class It3256IO {
  11. public:
  12. It3256IO() = default;
  13. ~It3256IO() = default;
  14. bool SetAIRangeCode(unsigned char startch, unsigned char stopch, unsigned char *poutbuf);
  15. bool GetAIRangeCode(unsigned char startch, unsigned char stopch, unsigned char *poutbuf);
  16. void ResetIt3256IOProxy();
  17. bool Reconnect();
  18. private:
  19. static constexpr int32_t MAX_RETRY_TIME = 3;
  20. bool GetIt3256IOProxy();
  21. std::mutex mutex_;
  22. bool isProxyValid_ = false;
  23. sptr<IIt3256IO> It3256IOProxy_;
  24. sptr<It3256IODeathRecipient> recipient_;
  25. friend class It3256IODeathRecipient;
  26. };
  27. } // namespace It3256
  28. } // namespace OHOS
  29. #endif //IT3256_H