mg_locals.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * File : mg_locals.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2017-08-19 armink first version
  23. */
  24. #ifndef _MONGOOSE_MG_LOCALS_H_
  25. #define _MONGOOSE_MG_LOCALS_H_
  26. #include <stdio.h>
  27. #include <stdint.h>
  28. #include <time.h>
  29. #include <lwip/sockets.h>
  30. #include <dfs_posix.h>
  31. #include <rtthread.h>
  32. #if defined(PKG_MONGOOSE_ENABLE_DEBUG)
  33. #define CS_ENABLE_DEBUG 1
  34. #else
  35. #define CS_ENABLE_DEBUG 0
  36. #endif
  37. #define CS_PLATFORM CS_P_STM32
  38. #define CS_DEFINE_DIRENT 0
  39. #define MG_ENABLE_HTTP_SSI 0
  40. #define MG_NET_IF MG_NET_IF_SOCKET
  41. #define MG_LWIP 1
  42. #define RTOS_SDK 1
  43. #define MG_MALLOC rt_malloc
  44. #define MG_CALLOC rt_calloc
  45. #define MG_REALLOC rt_realloc
  46. #define MG_FREE rt_free
  47. #define MG_STRDUP rt_strdup
  48. #define WEAK RT_WEAK
  49. #if defined(PKG_MONGOOSE_ENABLE_HTTP_WEBSOCKET)
  50. #define MG_ENABLE_HTTP_WEBSOCKET 1
  51. #else
  52. #define MG_ENABLE_HTTP_WEBSOCKET 0
  53. #endif
  54. #if defined(PKG_MONGOOSE_ENABLE_FILESYSTEM)
  55. #define MG_ENABLE_FILESYSTEM 1
  56. #else
  57. #define MG_ENABLE_FILESYSTEM 0
  58. #endif
  59. #if defined(PKG_MONGOOSE_ENABLE_HTTP_STREAMING_MULTIPART)
  60. #define MG_ENABLE_HTTP_STREAMING_MULTIPART 1
  61. #else
  62. #define MG_ENABLE_HTTP_STREAMING_MULTIPART 0
  63. #endif
  64. #if defined(PKG_MONGOOSE_ENABLE_MQTT)
  65. #define MG_ENABLE_MQTT 1
  66. #else
  67. #define MG_ENABLE_MQTT 0
  68. #endif
  69. #if defined(PKG_MONGOOSE_ENABLE_COAP)
  70. #define MG_ENABLE_COAP 1
  71. #else
  72. #define MG_ENABLE_COAP 0
  73. #endif
  74. #if defined(PKG_MONGOOSE_ENABLE_HEXDUMP)
  75. #define MG_ENABLE_HEXDUMP 1
  76. #else
  77. #define MG_ENABLE_HEXDUMP 0
  78. #endif
  79. #define fcntl(s,cmd,val) lwip_fcntl(s,cmd,val)
  80. /**
  81. * Mongoose Library port initialization
  82. */
  83. void mongoose_port_init(void);
  84. #endif /* _MONGOOSE_MG_LOCALS_H_ */