oriebirj

config.h

Oct 31st, 2021
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. #ifndef CONFIG_H_INCLUDED
  2. #define CONFIG_H_INCLUDED
  3.  
  4. /**************************************
  5. * Circular Buffer Configuration
  6. **************************************/
  7. #define BUFFER_SLOTS 32 /* max number of buffer */
  8. #define BUFFER_LENGTH 128 /* bytes per slot */
  9. #define SERIALIZE_BUFFER_SIZE 1024 /* bytes */
  10.  
  11. /**************************************
  12. * Configuration Definitions
  13. **************************************/
  14. #define NET_WIFI 1
  15. #define NET_WIFI_MESH 2
  16. #define NET_SERIAL 3
  17. #define NET_SIM800 4
  18. #define NET_SIM5360 5
  19. #define NET_SIM7600 6
  20. #define NET_SIM7070 7
  21.  
  22. #define STORAGE_NONE 0
  23. #define STORAGE_SPIFFS 1
  24. #define STORAGE_SD 2
  25.  
  26. #define GNSS_NONE 0
  27. #define GNSS_INTERNAL 1
  28. #define GNSS_EXTERNAL 2
  29. #define GNSS_CELLULAR 3
  30.  
  31. #define PROTOCOL_UDP 1
  32. #define PROTOCOL_HTTP 2
  33. #define PROTOCOL_HTTPS 3
  34.  
  35. #define PROTOCOL_METHOD_GET 0
  36. #define PROTOCOL_METHOD_POST 1
  37.  
  38. /**************************************
  39. * OBD-II configurations
  40. **************************************/
  41. #ifndef ENABLE_OBD
  42. #define ENABLE_OBD 1
  43. #endif
  44.  
  45. // maximum consecutive OBD access errors before entering standby
  46. #define MAX_OBD_ERRORS 3
  47.  
  48. /**************************************
  49. * Networking configurations
  50. **************************************/
  51. #ifndef NET_DEVICE
  52. // change the following line to change network device
  53. #define NET_DEVICE NET_SIM7600
  54. // WiFi settings
  55. #define WIFI_SSID "SSID"
  56. #define WIFI_PASSWORD "PASSWORD"
  57. // cellular network settings
  58. #define CELL_APN "data"
  59. // Freematics Hub server settings
  60. #define SERVER_HOST ""
  61. #define SERVER_PROTOCOL PROTOCOL_HTTP
  62. #endif
  63.  
  64. // SIM card setting
  65. #define SIM_CARD_PIN ""
  66.  
  67. // HTTPS settings
  68. #define SERVER_METHOD PROTOCOL_METHOD_POST
  69. #define SERVER_PATH "/hub/api"
  70.  
  71. #if !SERVER_PORT
  72. #undef SERVER_PORT
  73. #if SERVER_PROTOCOL == PROTOCOL_UDP
  74. #define SERVER_PORT 5170
  75. #elif SERVER_PROTOCOL == PROTOCOL_HTTP
  76. #define SERVER_PORT 80
  77. #elif SERVER_PROTOCOL == PROTOCOL_HTTPS
  78. #define SERVER_PORT 443
  79. #endif
  80. #endif
  81.  
  82. // WiFi Mesh settings
  83. #define WIFI_MESH_ID "123456"
  84. #define WIFI_MESH_CHANNEL 13
  85.  
  86. // WiFi AP settings
  87. #define WIFI_AP_SSID "TELELOGGER"
  88. #define WIFI_AP_PASSWORD "PASSWORD"
  89.  
  90. // maximum consecutive communication errors before resetting network
  91. #define MAX_CONN_ERRORS_RECONNECT 3
  92. // maximum allowed connecting time
  93. #define MAX_CONN_TIME 10000 /* ms */
  94. // data receiving timeout
  95. #define DATA_RECEIVING_TIMEOUT 5000 /* ms */
  96. // expected maximum server sync signal interval
  97. #define SERVER_SYNC_INTERVAL 120 /* seconds, 0 to disable */
  98. // data interval settings
  99. #define STATIONARY_TIME_TABLE {30, 60, 180} /* seconds */
  100. #define DATA_INTERVAL_TABLE {1000, 2000, 5000} /* ms */
  101. #define PING_BACK_INTERVAL 900 /* seconds */
  102.  
  103. /**************************************
  104. * Data storage configurations
  105. **************************************/
  106. #ifndef STORAGE
  107. // change the following line to change storage type
  108. #define STORAGE STORAGE_SD
  109. #endif
  110.  
  111. /**************************************
  112. * MEMS sensors
  113. **************************************/
  114. #define ENABLE_ORIENTATION 0
  115. #ifndef ENABLE_MEMS
  116. #define ENABLE_MEMS 1
  117. #endif
  118.  
  119. /**************************************
  120. * GPS
  121. **************************************/
  122. #ifndef GNSS
  123. // change the following line to change GNSS setting
  124. #define GNSS GNSS_INTERNAL
  125. #endif
  126. #define GPS_MOTION_TIMEOUT 180 /* seconds */
  127.  
  128. /**************************************
  129. * Standby/wakeup
  130. **************************************/
  131. #define RESET_AFTER_WAKEUP 1
  132. // motion threshold for waking up
  133. #define MOTION_THRESHOLD 0.4f /* moving vehicle motion threshold in G */
  134. // engine jumpstart voltage
  135. #define JUMPSTART_VOLTAGE 14 /* V */
  136.  
  137. /**************************************
  138. * Additional features
  139. **************************************/
  140. #define CONFIG_MODE_TIMEOUT 0
  141.  
  142. #define PIN_SENSOR1 34
  143. #define PIN_SENSOR2 26
  144.  
  145. #define COOLING_DOWN_TEMP 65 /* celsius degrees */
  146.  
  147. #endif // CONFIG_H_INCLUDED
  148.  
Advertisement
Add Comment
Please, Sign In to add comment