You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

166 regels
5.7 KiB

  1. /**
  2. * \file
  3. *
  4. * \brief MAIN configuration.
  5. *
  6. * Copyright (c) 2015 - 2018 Atmel Corporation. All rights reserved.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are met:
  14. *
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. *
  18. * 2. Redistributions in binary form must reproduce the above copyright notice,
  19. * this list of conditions and the following disclaimer in the documentation
  20. * and/or other materials provided with the distribution.
  21. *
  22. * 3. The name of Atmel may not be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  26. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  27. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  28. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  29. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  31. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  32. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  33. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  34. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  35. * POSSIBILITY OF SUCH DAMAGE.
  36. *
  37. * \asf_license_stop
  38. *
  39. */
  40. #ifndef MAIN_H_INCLUDED
  41. #define MAIN_H_INCLUDED
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. //#include "driver/include/m2m_wifi.h"
  46. //
  47. //// <<< Use Configuration Wizard in Context Menu >>>
  48. ////<h> General network settings in AP (access point) mode
  49. //// <s> Network SSID
  50. //// <id> app_main_m2m_device_name
  51. //#ifndef MAIN_M2M_SSID
  52. //#define MAIN_M2M_SSID "WINC1500_00:00"
  53. //#endif
  54. //
  55. //// <o> Security type
  56. //// <1=> Wi-Fi network is not secured
  57. //// <2=> WPA/WPA2 personal(PSK)
  58. //// <3=> WEP (40 or 104) OPEN OR SHARED
  59. //// <4=> WPA/WPA2 Enterprise.IEEE802.1x
  60. //// <id> app_main_m2m_ap_sec
  61. //#ifndef MAIN_M2M_AP_SEC
  62. //#define MAIN_M2M_AP_SEC 1
  63. //#endif
  64. //
  65. //// <s> Security key
  66. //// <id> app_main_m2m_ap_key
  67. //#ifndef MAIN_M2M_AP_KEY
  68. //#define MAIN_M2M_AP_KEY "12345FFFFF"
  69. //#endif
  70. //
  71. //// <o> SSID mode
  72. //// <0=>SSID is visible to others
  73. //// <1=>SSID is hidden
  74. //// <id> app_main_m2m_ap_ssid_mode
  75. //#ifndef MAIN_M2M_AP_SSID_MODE
  76. //#define MAIN_M2M_AP_SSID_MODE 0
  77. //#endif
  78. ////</h>
  79. ////<h> DHCP server IP address in AP (access point) mode
  80. //// <o> DHCP server IP address 1 <0-255>
  81. //// <id> app_ip_address_1
  82. //#ifndef DHCP_IP_ADDRESS_1
  83. //#define DHCP_IP_ADDRESS_1 192
  84. //#endif
  85. //
  86. //// <o> DHCP server IP address 2 <0-255>
  87. //// <id> app_ip_address_2
  88. //#ifndef DHCP_IP_ADDRESS_2
  89. //#define DHCP_IP_ADDRESS_2 168
  90. //#endif
  91. //
  92. //// <o> DHCP server IP address 3 <0-255>
  93. //// <id> app_ip_address_3
  94. //#ifndef DHCP_IP_ADDRESS_3
  95. //#define DHCP_IP_ADDRESS_3 1
  96. //#endif
  97. //
  98. //// <o> DHCP server IP address 4 <0-255>
  99. //// <id> app_ip_address_4
  100. //#ifndef DHCP_IP_ADDRESS_4
  101. //#define DHCP_IP_ADDRESS_4 1
  102. //#endif
  103. ////</h>
  104. //// <<< end of configuration section >>>
  105. //
  106. ///** Using broadcast address for simplicity. */
  107. //#define MAIN_SERVER_PORT (80)
  108. //
  109. ///** Using IP address. */
  110. //#define IPV4_BYTE(val, index) ((val >> (index * 8)) & 0xFF)
  111. //
  112. ///** Send buffer of TCP socket. */
  113. //#define MAIN_PREFIX_BUFFER "GET /data/2.5/weather?q="
  114. //#define MAIN_POST_BUFFER \
  115. // "&mode=xml&units=metric&appid=c592e14137c3471fa9627b44f6649db4 HTTP/1.1\r\nHost: " \
  116. // "api.openweathermap.org\r\nAccept: */*\r\n\r\n"
  117. ///** Weather information provider server. */
  118. //#define MAIN_WEATHER_SERVER_NAME "openweathermap.org"
  119. //
  120. ///** Input City Name. */
  121. //#define MAIN_CITY_NAME "london"
  122. //
  123. ///** Receive buffer size. */
  124. //#define MAIN_WIFI_M2M_BUFFER_SIZE 1024
  125. //
  126. //#define MAIN_M2M_DHCP_SERVER_IP \
  127. // { \
  128. // DHCP_IP_ADDRESS_1, DHCP_IP_ADDRESS_2, DHCP_IP_ADDRESS_3, DHCP_IP_ADDRESS_4 \
  129. // }
  130. //#define MAIN_HTTP_PROV_SERVER_DOMAIN_NAME "atmel.com"
  131. //
  132. //#define MAIN_MAC_ADDRESS \
  133. // { \
  134. // 0xf8, 0xf0, 0x05, 0x45, 0xD4, 0x84 \
  135. // }
  136. //
  137. //#define MAIN_HEX2ASCII(x) (((x) >= 10) ? (((x)-10) + 'A') : ((x) + '0'))
  138. //
  139. //#define TEMPERATURE_ABS(a) (((a) > 0) ? (a) : -(a))
  140. //
  141. //static tstrM2MAPConfig gstrM2MAPConfig = {MAIN_M2M_SSID,
  142. // 1,
  143. // 0,
  144. // sizeof(MAIN_M2M_AP_KEY) - 1,
  145. // MAIN_M2M_AP_KEY,
  146. // MAIN_M2M_AP_SEC,
  147. // MAIN_M2M_AP_SSID_MODE,
  148. // MAIN_M2M_DHCP_SERVER_IP};
  149. //
  150. //static CONST char gacHttpProvDomainName[] = MAIN_HTTP_PROV_SERVER_DOMAIN_NAME;
  151. //
  152. //static uint8 gau8MacAddr[] = MAIN_MAC_ADDRESS;
  153. //static sint8 gacDeviceName[] = MAIN_M2M_SSID;
  154. //
  155. //#define MAIN_WAITING_TIME 3000
  156. //#define MAIN_RETRY_COUNT 10
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160. #endif /* MAIN_H_INCLUDED */