task_msg_bus_user_def.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef TASK_MSG_BUS_USER_DEF_H_
  2. #define TASK_MSG_BUS_USER_DEF_H_
  3. struct msg_2_def
  4. {
  5. int id;
  6. char name[8];
  7. };
  8. enum task_msg_name{
  9. TASK_MSG_OS_REDAY = 0, //RT_NULL
  10. TASK_MSG_NET_REDAY, //json: net_reday:int,ip:string,id:int
  11. TASK_MSG_1,
  12. TASK_MSG_2, //struct msg_2_def
  13. TASK_MSG_3, //struct msg_3_def
  14. TASK_MSG_4,
  15. TASK_MSG_5,
  16. TASK_MSG_COUNT
  17. };
  18. #ifdef TASK_MSG_USING_DYNAMIC_MEMORY
  19. struct msg_3_def
  20. {
  21. int id;
  22. char name[8];
  23. rt_uint8_t *buffer;
  24. rt_size_t buffer_size;
  25. };
  26. extern void *msg_3_dump_hook(void *args);
  27. extern void msg_3_release_hook(void *args);
  28. #define task_msg_dump_release_hooks {\
  29. {TASK_MSG_OS_REDAY, RT_NULL, RT_NULL}, \
  30. {TASK_MSG_NET_REDAY, RT_NULL, RT_NULL}, \
  31. {TASK_MSG_1, RT_NULL, RT_NULL}, \
  32. {TASK_MSG_2, RT_NULL, RT_NULL}, \
  33. {TASK_MSG_3, msg_3_dump_hook, msg_3_release_hook}, \
  34. {TASK_MSG_4, RT_NULL, RT_NULL}, \
  35. {TASK_MSG_5, RT_NULL, RT_NULL}, \
  36. }
  37. #endif
  38. #endif