WirelessAgentSafeClient.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __WIRELESSDEVAGENT_SAFE_CLIENT_H
  2. #define __WIRELESSDEVAGENT_SAFE_CLIENT_H
  3. #pragma once
  4. #include "../mod_WirelessDevAgent/WirelessDevAgent_client_g.h"
  5. #include "../mod_WirelessDevAgent/WirelessDevAgent_msg_g.h"
  6. #include "MobileDialFSM.h"
  7. namespace MySpace {
  8. //class CMobileDialFSM;
  9. class WirelessAgentSafeClient
  10. {
  11. class WirelessDevClient : public WirelessDevAgent::WirelessDevService_ClientBase
  12. {
  13. public:
  14. explicit WirelessDevClient(CEntityBase* base):WirelessDevService_ClientBase(base){}
  15. };
  16. public:
  17. explicit WirelessAgentSafeClient(CMobileDialFSM* fsm);
  18. ~WirelessAgentSafeClient(void);
  19. ErrorCodeEnum IsActive(BOOL& isActive, BOOL& isConnected);
  20. ErrorCodeEnum GetAPNConfigs(int slotID, int& count, bool onlySimInfo = false, bool bClear = true);
  21. ErrorCodeEnum GetAPNConfigsPure(int nIndex, int& count);
  22. ErrorCodeEnum GetSIMInfo(int slotID, int& count);
  23. ErrorCodeEnum SetDefaultSlot(int slotIdx);
  24. ErrorCodeEnum DeleteProfile(int profileID);
  25. ErrorCodeEnum UpdateOrInsertAPN(int slotID, const AccessKeyInfo& newInfo, bool fApplyNow, int updateProfileID = 0);
  26. ErrorCodeEnum ConnectWithDefault();
  27. private:
  28. BOOL BeSureClientConnected(BOOL reConnnect = FALSE);
  29. void CloseSession();
  30. inline void _UpdateProfileInfo(ptMbnProfileInfo profileInfo, WirelessDevAgent::WirelessDevService_GetAPNConfigs_Ans& ans, int i);
  31. private:
  32. WirelessDevClient* _client;
  33. BOOL _connected;
  34. ErrorCodeEnum _lastError;
  35. CMobileDialFSM* _fsm;
  36. CRITICAL_SECTION cs_4_connect;
  37. };
  38. }
  39. #endif //__WIRELESSDEVAGENT_SAFE_CLIENT_H