twali_system.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef TWALI_SYSTEM_H_INCLUDED
  2. #define TWALI_SYSTEM_H_INCLUDED
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "upubsub.h"
  7. struct twali_system;
  8. struct twali_power;
  9. struct twali_task;
  10. struct twali_power * twali_system_power(struct twali_system * s);
  11. void twali_system_power_interrupt(void);
  12. struct twali_system * twali_system_make(void);
  13. void twali_system_start(struct twali_system * s);
  14. void twali_system_update(struct twali_system * s);
  15. void twali_system_wake_up(struct twali_system *s);
  16. int twali_system_publish_data(struct twali_system *s, const char * topic, void * mesg, size_t size);
  17. int twali_system_publish_str(struct twali_system *s, const char * topic, char * str);
  18. struct upubsub_listener * twali_system_subscribe_listener(struct twali_system *s,
  19. const char * topic, void * data, upubsub_listen_func * listen);
  20. struct upubsub_listener * twali_system_subscribe_task(struct twali_system *s,
  21. const char * topic, void * data, struct twali_task * task);
  22. int twali_system_unsubscribe_listener(struct twali_system *s,
  23. const char * topic, struct upubsub_listener * listener);
  24. struct upubsub_listener * twali_system_unsubscribe_task(struct twali_system *s,
  25. const char * topic, struct twali_task * task);
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif