bot_vendor.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * @file bot_vendor.h
  3. * @brief Standard Mode Adaptation Interface
  4. *
  5. * @copyright Copyright (C) 2015-2022 Ant Group Holding Limited
  6. */
  7. #ifndef __BOT_VENDOR_H__
  8. #define __BOT_VENDOR_H__
  9. #include "bot_network.h"
  10. #if defined(__cplusplus)
  11. extern "C" {
  12. #endif
  13. /**
  14. * @brief get network register mode.
  15. * @return netctrl status
  16. * @retval 0 manual mode
  17. * @retval 1 auto mode
  18. */
  19. int bot_network_netctrl_status_get(void);
  20. /**
  21. * @brief set network register mode.
  22. * @param[in] status 1: auto mode, 0: manual mode.
  23. * @return set result
  24. * @retval 0 success
  25. * @retval others failed
  26. */
  27. int bot_network_netctrl_status_set(int status);
  28. /**
  29. * @brief get network status.
  30. * @return see @ref bot_net_status_e
  31. */
  32. bot_net_status_e bot_network_status_get(void);
  33. /**
  34. * @brief set maas channel sim id and cid, must be called before @ref bot_maas_init
  35. * @note maas channel default sim id is 0, cid is 3
  36. * users can set their own cid, but do not conflict with the existing cid
  37. *
  38. * @param[in] sim sim card index
  39. * @param[in] cid PDP channel index
  40. *
  41. * @return set result
  42. * @retval 0 success
  43. * @retval others failed
  44. *
  45. */
  46. int bot_network_sim_cid_set(int sim, int cid);
  47. /**
  48. * @brief get maas channel sim id and cid
  49. *
  50. * @param[out] sim sim card index
  51. * @param[out] cid PDP channel index
  52. *
  53. * @return set result
  54. * @retval 0 success
  55. * @retval others failed
  56. *
  57. */
  58. int bot_network_sim_cid_get(int *sim, int *cid);
  59. /**
  60. * @brief Format the input error code to string
  61. *
  62. * @param[in] error_code error code number
  63. * @param[out] errno_buff: buffer to store the formatted string, buffer length is not less than 12
  64. * @param[in] len length of errno_buff
  65. *
  66. * @return format result
  67. * @retval 0 success
  68. * @retval -1 failed
  69. */
  70. int bot_errno_fmt(int error_code, char *errno_buff, unsigned int len);
  71. /**
  72. * @brief Get the test cmd return of AT command
  73. *
  74. * @param[in] cmd_str AT command (example: AT+MAASREGSTATUS)
  75. * @return test string (example: +MAASREGSTATUS: 64)
  76. * @retval NULL failed
  77. * @retval others string pointer
  78. */
  79. const char *bot_at_test_cmd_get(const char *cmd_str);
  80. /**
  81. * @brief MaaS debug set/get
  82. *
  83. * @param[in] para_in input para, string format
  84. * @param[out] para_out address to store output para, at least 512 Bytes
  85. * @param[in/out] out_len: [in] the length of address; [out] the length of the output para;
  86. * @return command execution result On success, return 0
  87. * @retval 0 success
  88. * @retval others failed
  89. */
  90. int bot_maas_debug(const char *para_in, char *para_out, unsigned int *out_len);
  91. #if defined(__cplusplus)
  92. }
  93. #endif
  94. #endif