1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! Low-level bindings to Notificcation API.

use core::ffi::c_char;

use crate::{c_string, opaque};

pub const RECORD_NOTIFICATION: *const c_char = c_string!("notification");

opaque!(Notification);
opaque!(NotificationSequence);

extern "C" {
    #[link_name = "notification_message"]
    pub fn message(notifications_app: *mut Notification, sequence: *const NotificationSequence);
}

pub mod vibro {
    use super::NotificationSequence;

    extern "C" {
        #[link_name = "sequence_set_vibro_on"]
        pub static ON: NotificationSequence;
        #[link_name = "sequence_reset_vibro"]
        pub static OFF: NotificationSequence;
    }
}

pub mod led {
    pub mod red {
        use super::super::*;

        extern "C" {
            #[link_name = "sequence_blink_red_10"]
            pub static BLINK_10: NotificationSequence;
            #[link_name = "sequence_blink_red_100"]
            pub static BLINK_100: NotificationSequence;
        }
    }

    pub mod green {
        use super::super::*;

        extern "C" {
            #[link_name = "sequence_blink_green_10"]
            pub static BLINK_10: NotificationSequence;
            #[link_name = "sequence_blink_green_100"]
            pub static BLINK_100: NotificationSequence;
        }
    }

    pub mod blue {
        use super::super::*;

        extern "C" {
            #[link_name = "sequence_blink_blue_10"]
            pub static BLINK_10: NotificationSequence;
            #[link_name = "sequence_blink_blue_100"]
            pub static BLINK_100: NotificationSequence;
        }
    }

    pub mod yellow {
        use super::super::*;

        extern "C" {
            #[link_name = "sequence_blink_yellow_10"]
            pub static BLINK_10: NotificationSequence;
            #[link_name = "sequence_blink_yellow_100"]
            pub static BLINK_100: NotificationSequence;
        }
    }

    pub mod cyan {
        use super::super::*;

        extern "C" {
            #[link_name = "sequence_blink_cyan_10"]
            pub static BLINK_10: NotificationSequence;
            #[link_name = "sequence_blink_cyan_100"]
            pub static BLINK_100: NotificationSequence;
        }
    }

    pub mod magenta {
        use super::super::*;

        extern "C" {
            #[link_name = "sequence_blink_magenta_10"]
            pub static BLINK_10: NotificationSequence;
            #[link_name = "sequence_blink_magenta_100"]
            pub static BLINK_100: NotificationSequence;
        }
    }
}