@@ -10,7 +10,6 @@ typedef struct {
10
10
uint16_t svc_handle ;
11
11
uint16_t protocol_mode_char_handle ;
12
12
uint16_t report_char_handle [HID_SVC_REPORT_COUNT ];
13
- uint16_t report_ref_desc_handle [HID_SVC_REPORT_COUNT ];
14
13
uint16_t report_map_char_handle ;
15
14
uint16_t info_char_handle ;
16
15
uint16_t ctrl_point_char_handle ;
@@ -39,7 +38,6 @@ void hid_svc_start() {
39
38
tBleStatus status ;
40
39
hid_svc = malloc (sizeof (HIDSvc ));
41
40
Service_UUID_t svc_uuid = {};
42
- Char_Desc_Uuid_t desc_uuid = {};
43
41
Char_UUID_t char_uuid = {};
44
42
45
43
// Register event handler
@@ -88,7 +86,6 @@ void hid_svc_start() {
88
86
#if (HID_SVC_REPORT_COUNT != 0 )
89
87
for (uint8_t i = 0 ; i < HID_SVC_REPORT_COUNT ; i ++ ) {
90
88
if (i < HID_SVC_INPUT_REPORT_COUNT ) {
91
- uint8_t buf [2 ] = {i , 1 }; // 1 input
92
89
char_uuid .Char_UUID_16 = REPORT_CHAR_UUID ;
93
90
status = aci_gatt_add_char (
94
91
hid_svc -> svc_handle ,
@@ -104,27 +101,7 @@ void hid_svc_start() {
104
101
if (status ) {
105
102
FURI_LOG_E (TAG , "Failed to add report characteristic: %d" , status );
106
103
}
107
-
108
- desc_uuid .Char_UUID_16 = REPORT_REFERENCE_DESCRIPTOR_UUID ;
109
- status = aci_gatt_add_char_desc (
110
- hid_svc -> svc_handle ,
111
- hid_svc -> report_char_handle [i ],
112
- UUID_TYPE_16 ,
113
- & desc_uuid ,
114
- HID_SVC_REPORT_REF_LEN ,
115
- HID_SVC_REPORT_REF_LEN ,
116
- buf ,
117
- ATTR_PERMISSION_NONE ,
118
- ATTR_ACCESS_READ_ONLY ,
119
- GATT_DONT_NOTIFY_EVENTS ,
120
- MIN_ENCRY_KEY_SIZE ,
121
- CHAR_VALUE_LEN_CONSTANT ,
122
- & (hid_svc -> report_ref_desc_handle [i ]));
123
- if (status ) {
124
- FURI_LOG_E (TAG , "Failed to add report reference descriptor: %d" , status );
125
- }
126
104
} else if ((i - HID_SVC_INPUT_REPORT_COUNT ) < HID_SVC_OUTPUT_REPORT_COUNT ) {
127
- uint8_t buf [2 ] = {i , 2 }; // 2 output
128
105
char_uuid .Char_UUID_16 = REPORT_CHAR_UUID ;
129
106
status = aci_gatt_add_char (
130
107
hid_svc -> svc_handle ,
@@ -140,27 +117,7 @@ void hid_svc_start() {
140
117
if (status ) {
141
118
FURI_LOG_E (TAG , "Failed to add report characteristic: %d" , status );
142
119
}
143
-
144
- desc_uuid .Char_UUID_16 = REPORT_REFERENCE_DESCRIPTOR_UUID ;
145
- status = aci_gatt_add_char_desc (
146
- hid_svc -> svc_handle ,
147
- hid_svc -> report_char_handle [i ],
148
- UUID_TYPE_16 ,
149
- & desc_uuid ,
150
- HID_SVC_REPORT_REF_LEN ,
151
- HID_SVC_REPORT_REF_LEN ,
152
- buf ,
153
- ATTR_PERMISSION_NONE ,
154
- ATTR_ACCESS_READ_ONLY ,
155
- GATT_DONT_NOTIFY_EVENTS ,
156
- MIN_ENCRY_KEY_SIZE ,
157
- CHAR_VALUE_LEN_CONSTANT ,
158
- & (hid_svc -> report_ref_desc_handle [i ]));
159
- if (status ) {
160
- FURI_LOG_E (TAG , "Failed to add report reference descriptor: %d" , status );
161
- }
162
120
} else {
163
- uint8_t buf [2 ] = {i , 3 }; // 3 feature
164
121
char_uuid .Char_UUID_16 = REPORT_CHAR_UUID ;
165
122
status = aci_gatt_add_char (
166
123
hid_svc -> svc_handle ,
@@ -176,25 +133,6 @@ void hid_svc_start() {
176
133
if (status ) {
177
134
FURI_LOG_E (TAG , "Failed to add report characteristic: %d" , status );
178
135
}
179
-
180
- desc_uuid .Char_UUID_16 = REPORT_REFERENCE_DESCRIPTOR_UUID ;
181
- status = aci_gatt_add_char_desc (
182
- hid_svc -> svc_handle ,
183
- hid_svc -> report_char_handle [i ],
184
- UUID_TYPE_16 ,
185
- & desc_uuid ,
186
- HID_SVC_REPORT_REF_LEN ,
187
- HID_SVC_REPORT_REF_LEN ,
188
- buf ,
189
- ATTR_PERMISSION_NONE ,
190
- ATTR_ACCESS_READ_ONLY ,
191
- GATT_DONT_NOTIFY_EVENTS ,
192
- MIN_ENCRY_KEY_SIZE ,
193
- CHAR_VALUE_LEN_CONSTANT ,
194
- & (hid_svc -> report_ref_desc_handle [i ]));
195
- if (status ) {
196
- FURI_LOG_E (TAG , "Failed to add report reference descriptor: %d" , status );
197
- }
198
136
}
199
137
}
200
138
#endif
0 commit comments