at_cmd_coap.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include "ats_config.h"
  2. #ifdef CONFIG_AT_LIBCOAP_SUPPORT
  3. #include "at_engine.h"
  4. #include "at_command.h"
  5. #include "sockets.h"
  6. #define COAP_MESSAGE_MAX_SIZE 64 /* maximum size of one block.num message */
  7. #define COAP_BLOCK_MAX_SIZE 64 /* maximum size of block */
  8. struct addrinfo
  9. {
  10. int ai_flags; /* Input flags. */
  11. int ai_family; /* Address family of socket. */
  12. int ai_socktype; /* Socket type. */
  13. int ai_protocol; /* Protocol of socket. */
  14. socklen_t ai_addrlen; /* Length of socket address. */
  15. struct sockaddr *ai_addr; /* Socket address of socket. */
  16. char *ai_canonname; /* Canonical name of service location. */
  17. struct addrinfo *ai_next; /* Pointer to next in list. */
  18. };
  19. typedef struct _coap_data
  20. {
  21. uint8_t *gBuff[COAP_BLOCK_MAX_SIZE];
  22. int gNum;
  23. int gLength;
  24. int gLen[COAP_BLOCK_MAX_SIZE];
  25. osiTimer_t *timerID;
  26. } COAP_DATA_T;
  27. /* Socket protocol types (TCP/UDP/RAW) */
  28. #define SOCK_STREAM 1
  29. #define SOCK_DGRAM 2
  30. #define SOCK_RAW 3
  31. #define AI_PASSIVE 1
  32. #define AI_CANONNAME 2
  33. #define AI_NUMERICHOST 4
  34. #define AF_UNSPEC 0
  35. #define AF_INET 2
  36. #define PF_INET AF_INET
  37. #define PF_UNSPEC AF_UNSPEC
  38. // #define stderr 12
  39. #define AT_COAP_ADDRLEN 50
  40. void AT_COAP_CmdFunc_START(atCommand_t *pParam);
  41. void AT_COAP_CmdFunc_READ(atCommand_t *pParam);
  42. #endif