]> git.kernelconcepts.de Git - metawatch.git/blob - metawatch_protocol.h
Add language selection
[metawatch.git] / metawatch_protocol.h
1 /*
2  * (c) 2011 Siegen, Germany by Nils Faerber <nils.faerber@kernelconcepts.de>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef _MW_PROT_H
21 #define _MW_PROT_H
22
23 #define MW_SOF                          0x01
24
25 /* general */
26 #define MW_GET_DEVICE_TYPE              0x01
27 #define MW_GET_DEVICE_TYPE_RSP          0x02
28
29 #define MW_DEVICE_TYPE_RESERVED         0x00
30 #define MW_DEVICE_TYPE_ANA_DIGI         0x01
31 #define MW_DEVICE_TYPE_DIGITAL          0x02
32 #define MW_DEVICE_TYPE_DEVB_DIGI        0x03
33 #define MW_DEVICE_TYPE_DEVB_ANA_DIGI    0x04
34
35 #define MW_GET_INFORMATION_STRING       0x03
36 #define MW_GET_INFORMATION_STRING_RSP   0x04
37
38 /* specific for ana-digi version */
39 #define MW_UPDATE_OLED_DISPLAY_MSG      0x10
40 #define MW_WRITE_OLED_IDLE_DISPLAY_MSG  0x11
41 #define MW_WRITE_OLED_SCROLL_BUFFER_MSG 0x15
42 #define MW_ENABLE_OLED_DISPLAY_MSG      0x16
43 #define MW_ADVANCE_WATCH_HANDS          0x20
44
45 #define MW_SET_VIBRATE_MODE             0x23
46
47 #define MW_SET_REAL_TIME_CLOCK          0x26
48 #define MW_GET_REAL_TIME_CLOCK          0x27
49 #define MW_GET_REAL_TIME_CLOCK_RSP      0x28
50
51 #define MW_RTC_CLOCK_12HR               0x00
52 #define MW_RTC_CLOCK_24HR               0x01
53 #define MW_RTC_DATE_MMDD                0x00
54 #define MW_RTC_DATE_DDMM                0x01
55
56 #define MW_LANG_EN                      0x00
57 #define MW_LANG_FI                      0x01
58 #define MW_LANG_DE                      0x02
59
60 #define MW_NVAL_OPERATION               0x30
61 #define MW_NVAL_OPERATION_RSP           0x31
62
63 #define MW_NVAL_OPERATION_READ          0x01
64 #define MW_NVAL_OPERATION_WRITE         0x02
65 #define MW_NVAL_TIME_FORMAT             0x2009
66 #define MW_NVAL_DATE_FORMAT             0x200a
67 #define MW_NVAL_LANGUAGE                0x200c
68
69 #define MW_RESERVED                     0x32
70 #define MW_STATUS_CHANGE_EVENT          0x33
71 #define MW_BUTTON_EVENT_MESSAGE         0x34
72
73 /* specific for digital version */
74 #define MW_WRITE_BUFFER                 0x40
75 #define MW_CONFIGURE_MODE               0x41
76 #define MW_CONFIGURE_IDLE_BUFFER_SIZE   0x42
77 #define MW_UPDATE_DISPLAY               0x43
78 #define MW_LOAD_TEMPLATE                0x44
79 #define MW_RESERVED2                    0x45
80 #define MW_ENABLE_BUTTON                0x46
81 #define MW_DISABLE_BUTTON               0x47
82 /* READ_BUTTON_* have been removed from the spec */
83 #define MW_READ_BUTTON_CONFIG           0x48
84 #define MW_READ_BUTTON_CONFIG_RSP       0x49
85 #define MW_RESERVED3                    0x4a
86
87 #define MW_BATTERY_CONFIG_MSG           0x53
88 #define MW_LOW_BATTERY_WARNING_MSG      0x54
89 #define MW_LOW_BATTERY_BT_OFF_MSG       0x55
90 #define MW_READ_BATTERY_VOLTAGE_MSG     0x56
91 #define MW_READ_BATTERY_VOLTAGE_RSP     0x57
92 #define MW_READ_LIGHT_SENSOR_MSG        0x58
93 #define MW_READ_LIGHT_SENSOR_RSP        0x59
94 #define MW_ACCELEROMETER                0xea
95
96
97 /* screen modes */
98 #define MW_SCREEN_MODE_IDLE             0x00
99 #define MW_SCREEN_MODE_APPLICATION      0x01
100 #define MW_SCREEN_MODE_NOTIFICATION     0x02
101 #define MW_SCREEN_MODE_SCROLL           0x03
102
103
104 /* button definitions */
105 #define MW_BUTTON_A                     0x00
106 #define MW_BUTTON_B                     0x01
107 #define MW_BUTTON_C                     0x02
108 #define MW_BUTTON_D                     0x03
109 #define MW_BUTTON_RES4                  0x04
110 #define MW_BUTTON_E                     0x05
111 #define MW_BUTTON_F                     0x06
112 #define MW_BUTTON_PULLSW                0x07
113
114 /* button events */
115 #define MW_BUTTON_IMMEDIATE             0x00
116 #define MW_BUTTON_PRESS_AND_RELEASE     0x01
117 #define MW_BUTTON_HOLD_RELEASE          0x02
118 #define MW_BUTTON_LONG_HOLD_RELEASE     0x03
119
120 /* OLEDs */
121
122 #define MW_OLED_UPPER                   0x00
123 #define MW_OLED_LOWER                   0x01
124
125 #endif
126