twali_system.h 1.6 KB

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