sd_notify.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #include "sd_notify.h"
  2. static const NotificationSequence sd_sequence_success = {
  3. &message_green_255,
  4. &message_delay_50,
  5. &message_green_0,
  6. &message_delay_50,
  7. &message_green_255,
  8. &message_delay_50,
  9. &message_green_0,
  10. &message_delay_50,
  11. &message_green_255,
  12. &message_delay_50,
  13. &message_green_0,
  14. &message_delay_50,
  15. NULL,
  16. };
  17. static const NotificationSequence sd_sequence_error = {
  18. &message_red_255,
  19. &message_delay_50,
  20. &message_red_0,
  21. &message_delay_50,
  22. &message_red_255,
  23. &message_delay_50,
  24. &message_red_0,
  25. &message_delay_50,
  26. &message_red_255,
  27. &message_delay_50,
  28. &message_red_0,
  29. &message_delay_50,
  30. NULL,
  31. };
  32. static const NotificationSequence sd_sequence_eject = {
  33. &message_blue_255,
  34. &message_delay_50,
  35. &message_blue_0,
  36. &message_delay_50,
  37. &message_blue_255,
  38. &message_delay_50,
  39. &message_blue_0,
  40. &message_delay_50,
  41. &message_blue_255,
  42. &message_delay_50,
  43. &message_blue_0,
  44. &message_delay_50,
  45. NULL,
  46. };
  47. static const NotificationSequence sd_sequence_wait = {
  48. &message_red_255,
  49. &message_blue_255,
  50. &message_do_not_reset,
  51. NULL,
  52. };
  53. static const NotificationSequence sd_sequence_wait_off = {
  54. &message_red_0,
  55. &message_blue_0,
  56. NULL,
  57. };
  58. void sd_notify_wait(NotificationApp* notifications) {
  59. notification_message(notifications, &sd_sequence_wait);
  60. }
  61. void sd_notify_wait_off(NotificationApp* notifications) {
  62. notification_message(notifications, &sd_sequence_wait_off);
  63. }
  64. void sd_notify_success(NotificationApp* notifications) {
  65. notification_message(notifications, &sd_sequence_success);
  66. }
  67. void sd_notify_eject(NotificationApp* notifications) {
  68. notification_message(notifications, &sd_sequence_eject);
  69. }
  70. void sd_notify_error(NotificationApp* notifications) {
  71. notification_message(notifications, &sd_sequence_error);
  72. }