wangzhibo
4 天以前 ae6f40460dcd56af6c5f60ba52c883854c3bac55
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*  Copyright (C) 2020-2024 Taavi Eomäe
 
    This file is part of Gadgetbridge.
 
    Gadgetbridge is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published
    by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
 
    Gadgetbridge is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.
 
    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.nut;
 
import java.util.UUID;
 
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
 
public class NutConstants {
    /**
     * Just battery info
     */
    public static final UUID SERVICE_BATTERY = GattService.UUID_SERVICE_BATTERY_SERVICE;
    public static final UUID CHARAC_BATTERY_INFO = UUID.fromString("00002a19-0000-1000-8000-00805f9b34fb");
 
    /**
     * Device info available.
     **/
    public static final UUID SERVICE_DEVICE_INFO = GattService.UUID_SERVICE_DEVICE_INFORMATION;
    /**
     * Firmware version.
     * Used with {@link NutConstants#SERVICE_DEVICE_INFO}
     */
    public static final UUID CHARAC_FIRMWARE_VERSION = UUID.fromString("00002a26-0000-1000-8000-00805f9b34fb");
    /**
     * System ID.
     * Used with {@link NutConstants#SERVICE_DEVICE_INFO}
     */
    public static final UUID CHARAC_SYSTEM_ID = UUID.fromString("00002a23-0000-1000-8000-00805f9b34fb");
    /**
     * Hardware version.
     * Used with {@link NutConstants#SERVICE_DEVICE_INFO}
     */
    public static final UUID CHARAC_HARDWARE_VERSION = UUID.fromString("00002a27-0000-1000-8000-00805f9b34fb");
    /**
     * Manufacturer name.
     * Used with {@link NutConstants#SERVICE_DEVICE_INFO}
     */
    public static final UUID CHARAC_MANUFACTURER_NAME = UUID.fromString("00002a29-0000-1000-8000-00805f9b34fb");
 
 
    /**
     * Link loss alert service.
     */
    public static final UUID SERVICE_LINK_LOSS = UUID.fromString("00001803-0000-1000-8000-00805f9b34fb");
 
 
    /**
     * Immediate alert service.
     */
    public static final UUID SERVICE_IMMEDIATE_ALERT = UUID.fromString("00001802-0000-1000-8000-00805f9b34fb");
    /**
     * Immediate alert level
     * Used with {@link NutConstants#SERVICE_IMMEDIATE_ALERT}
     */
    public static final UUID CHARAC_LINK_LOSS_ALERT_LEVEL = UUID.fromString("00002a06-0000-1000-8000-00805f9b34fb");
 
 
    /**
     * Proprietary command endpoint.
     * TODO: Anything else in this service on other devices?
     */
    public static final UUID SERVICE_PROPRIETARY_NUT = UUID.fromString("0000ff00-0000-1000-8000-00805f9b34fb");
    /**
     * Shutdown or reset.
     * Used with {@link NutConstants#SERVICE_PROPRIETARY_NUT}
     */
    public static final UUID CHARAC_CHANGE_POWER = UUID.fromString("0000ff01-0000-1000-8000-00805f9b34fb");
    /**
     * Commands for proprietary service.
     * Used with {@link NutConstants#SERVICE_PROPRIETARY_NUT}
     */
    public static final UUID CHARAC_DFU_PW = UUID.fromString("0000ff02-0000-1000-8000-00805f9b34fb");
    /**
     * Authentication using 16-byte key?
     * Used with {@link NutConstants#SERVICE_PROPRIETARY_NUT}
     * TODO: Exists only on Nut Mini?
     */
    public static final UUID CHARAC_AUTH_STATUS = UUID.fromString("0000ff05-0000-1000-8000-00805f9b34fb");
 
 
    /**
     * Ringing configuration.
     * TODO: Exact purpose?
     */
    public static final UUID SERVICE_UNKNOWN_2 = UUID.fromString("0000ffe0-0000-1000-8000-00805f9b34fb");
    /**
     * Ringing configuration.
     * Used with {@link NutConstants#SERVICE_UNKNOWN_2}
     * TODO: Something else on other devices?
     */
    public static final UUID CHARAC_UNKNOWN_2 = UUID.fromString("0000ffe1-0000-1000-8000-00805f9b34fb");
 
 
    /**
     * Very little mention online, specific to Nut devices?
     */
    public static final UUID UNKNOWN_3 = UUID.fromString("00001530-0000-1000-8000-00805f9b34fb");
}