dm_module.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _DM_MODULE_H_
  13. #define _DM_MODULE_H_
  14. #include "net_config.h"
  15. #if defined(CONFIG_NET_DM_CISSDK_SUPPORT) || defined(CONFIG_NET_DM_LWM2M_SUPPORT)
  16. typedef struct _DM_PLAT_CONFIG_T
  17. {
  18. bool isAdapterPlatform;
  19. } DM_PLAT_CONFIG_T;
  20. #elif defined(CONFIG_NET_DM_CUS_SUPPORT)
  21. typedef enum _DM_CUS_STATE_E
  22. {
  23. DM_CUS_STATE_INITIAL = 0,
  24. DM_CUS_STATE_DNS_SUCC = 1,
  25. DM_CUS_STATE_CONNECT_SUCC = 4,
  26. DM_CUS_STATE_CONNECT_FAILED = 5,
  27. DM_CUS_STATE_REG_SUCC = 6,
  28. DM_CUS_STATE_REG_FAILED = 7,
  29. DM_CUS_STATE_REG_TIMEOUT = 8,
  30. DM_CUS_STATE_LIFETIME_TIMEOUT = 9,
  31. DM_CUS_STATE_UPDATE_SUCC = 11,
  32. DM_CUS_STATE_UPDATE_FAILED = 12,
  33. DM_CUS_STATE_UPDATE_TIMEOUT = 13
  34. } DM_CUS_STATE_E;
  35. #define MAX_SERVER_IP_SIZE 32
  36. #define MAX_APP_KEY_SIZE 32
  37. #define MAX_PASSWORD_SIZE 64
  38. #define MIN_TML_IMEI_SIZE 15
  39. #define MAX_TML_IMEI_SIZE 17
  40. typedef struct _DM_CUS_CONFIG_T
  41. {
  42. bool DM_mode;
  43. bool Server_type; //1 manual, 0 auto
  44. char Server_IP[MAX_SERVER_IP_SIZE + 1];
  45. uint16_t Server_Port;
  46. uint32_t update_period;
  47. char APP_key[MAX_APP_KEY_SIZE + 1];
  48. char password[MAX_PASSWORD_SIZE + 1];
  49. uint32_t if_type;
  50. char tml_IMEI[MAX_TML_IMEI_SIZE + 1];
  51. uint32_t PLMN[3];
  52. } DM_CUS_CONFIG_T;
  53. #define MAX_APP_INFO_SIZE 255
  54. #define MAX_MAC_SIZE 19
  55. #define MAX_ROM_SIZE 19
  56. #define MAX_RAM_SIZE 19
  57. #define MAX_CPU_SIZE 19
  58. #define MAX_OS_SYS_VER_SIZE 47
  59. #define MAX_SW_VER_SIZE 47
  60. #define MAX_SW_NAME_SIZE 47
  61. #define MAX_VOLTE_SIZE 7
  62. #define MAX_NET_TYPE_SIZE 19
  63. #define MAX_ACCOUT_SIZE 47
  64. #define MAX_PHONE_NUM_SIZE 19
  65. #define MAX_LOCATION_SIZE 255
  66. typedef struct _DM_CUS_CONFIG_EX_T
  67. {
  68. char APP_info[MAX_APP_INFO_SIZE + 1];
  69. char MAC[MAX_MAC_SIZE + 1];
  70. char ROM[MAX_ROM_SIZE + 1];
  71. char RAM[MAX_RAM_SIZE + 1];
  72. char CPU[MAX_CPU_SIZE + 1];
  73. char osSysVer[MAX_OS_SYS_VER_SIZE + 1];
  74. char swVer[MAX_SW_VER_SIZE + 1];
  75. char swname[MAX_SW_NAME_SIZE + 1];
  76. char VoLTE[MAX_VOLTE_SIZE + 1];
  77. char net_type[MAX_NET_TYPE_SIZE + 1];
  78. char account[MAX_ACCOUT_SIZE + 1];
  79. char phoneNum[MAX_PHONE_NUM_SIZE + 1];
  80. char location[MAX_LOCATION_SIZE + 1];
  81. } DM_CUS_CONFIG_EX_T;
  82. typedef struct _DM_CUS_STATE_T
  83. {
  84. DM_CUS_STATE_E dm_state;
  85. DM_CUS_CONFIG_T *dm_current_config;
  86. } DM_CUS_STATE_T;
  87. bool dm_platform_setEX(void *config);
  88. bool dm_platform_getEX(void *config);
  89. #endif
  90. void dm_register(uint8_t nSimId);
  91. void dm_register_init(uint8_t self_register);
  92. bool dm_platform_set(void *config);
  93. bool dm_platform_get(void *config);
  94. bool dm_state_get(void *state);
  95. #ifdef CONFIG_AT_CUS_SUPPORT
  96. void dm_lwm2m_init();
  97. #endif
  98. #ifdef CONFIG_NET_CTWING_SELFREG_SUPPORT
  99. void dm_aep_init();
  100. #endif
  101. #ifdef CONFIG_NBSELFREG_CUS_SUPPORT
  102. void coap_register_init();
  103. #else
  104. void coap_register_init(int flag);
  105. #endif
  106. #endif