ql_ctsreg.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*================================================================
  2. Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
  3. Quectel Wireless Solutions Proprietary and Confidential.
  4. =================================================================*/
  5. #ifndef QL_CTSREG_H
  6. #define QL_CTSREG_H
  7. #define ctsreg_print(msg, ...) custom_log_tag("CTSREG", QUEC_LOG_TAG_CTSREG, msg, ##__VA_ARGS__)
  8. typedef long ql_ctsreg_hndl;
  9. typedef enum{
  10. QL_CTSREG_RESPONSE_ERR = -19,
  11. QL_CTSREG_INVALID_PRM = -10,
  12. QL_CTSREG_OUT_OF_MEM = -9,
  13. QL_CTSREG_WOULD_BLOCK = -2,
  14. QL_CTSREG_REG_PDP_S = 0,
  15. QL_CTSREG_REG_PDP_OK,
  16. QL_CTSREG_REG_PDP_NOK,
  17. QL_CTSREG_DNS_PARSE_S,
  18. QL_CTSREG_DNS_PARSE_OK,
  19. QL_CTSREG_DNS_PARSE_NOK,
  20. QL_CTSREG_SEND_DATA_S,
  21. QL_CTSREG_SEND_DATA_OK,
  22. QL_CTSREG_SEND_DATA_NOK,
  23. QL_CTSREG_REG_OK,
  24. QL_CTSREG_REG_NOK,
  25. QL_CTSREG_REG_A,
  26. }ql_ctsreg_state_code;
  27. typedef struct{
  28. char model_id[48];
  29. char sw_version[128];
  30. char iccid[64];
  31. char imei[64];
  32. char imsi[64];
  33. char cellid[64];
  34. char date[128];
  35. }ql_ctsreg_param_t;
  36. typedef struct{
  37. int contextid;
  38. int sim_id;
  39. char server_addr[256];
  40. uint16_t server_port;
  41. char registered_iccid[64];
  42. int encrypt;
  43. int retry_cnt;
  44. int resp_timeout;
  45. int interval_timeout;
  46. }ql_ctsreg_option_t;
  47. typedef void (*ctsreg_state_cb)(ql_ctsreg_hndl cli_hndl, int state_code, int finished, void *arg);
  48. ql_ctsreg_hndl ql_ctsreg_perform(ql_ctsreg_option_t *option, ql_ctsreg_param_t * reg_param, ctsreg_state_cb state_cb, void *arg, int *err_num);
  49. #endif