@@ -10,7 +10,6 @@ typedef struct {
1010 uint16_t svc_handle ;
1111 uint16_t protocol_mode_char_handle ;
1212 uint16_t report_char_handle [HID_SVC_REPORT_COUNT ];
13- uint16_t report_ref_desc_handle [HID_SVC_REPORT_COUNT ];
1413 uint16_t report_map_char_handle ;
1514 uint16_t info_char_handle ;
1615 uint16_t ctrl_point_char_handle ;
@@ -39,7 +38,6 @@ void hid_svc_start() {
3938 tBleStatus status ;
4039 hid_svc = malloc (sizeof (HIDSvc ));
4140 Service_UUID_t svc_uuid = {};
42- Char_Desc_Uuid_t desc_uuid = {};
4341 Char_UUID_t char_uuid = {};
4442
4543 // Register event handler
@@ -88,7 +86,6 @@ void hid_svc_start() {
8886#if (HID_SVC_REPORT_COUNT != 0 )
8987 for (uint8_t i = 0 ; i < HID_SVC_REPORT_COUNT ; i ++ ) {
9088 if (i < HID_SVC_INPUT_REPORT_COUNT ) {
91- uint8_t buf [2 ] = {i , 1 }; // 1 input
9289 char_uuid .Char_UUID_16 = REPORT_CHAR_UUID ;
9390 status = aci_gatt_add_char (
9491 hid_svc -> svc_handle ,
@@ -104,27 +101,7 @@ void hid_svc_start() {
104101 if (status ) {
105102 FURI_LOG_E (TAG , "Failed to add report characteristic: %d" , status );
106103 }
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- }
126104 } else if ((i - HID_SVC_INPUT_REPORT_COUNT ) < HID_SVC_OUTPUT_REPORT_COUNT ) {
127- uint8_t buf [2 ] = {i , 2 }; // 2 output
128105 char_uuid .Char_UUID_16 = REPORT_CHAR_UUID ;
129106 status = aci_gatt_add_char (
130107 hid_svc -> svc_handle ,
@@ -140,27 +117,7 @@ void hid_svc_start() {
140117 if (status ) {
141118 FURI_LOG_E (TAG , "Failed to add report characteristic: %d" , status );
142119 }
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- }
162120 } else {
163- uint8_t buf [2 ] = {i , 3 }; // 3 feature
164121 char_uuid .Char_UUID_16 = REPORT_CHAR_UUID ;
165122 status = aci_gatt_add_char (
166123 hid_svc -> svc_handle ,
@@ -176,25 +133,6 @@ void hid_svc_start() {
176133 if (status ) {
177134 FURI_LOG_E (TAG , "Failed to add report characteristic: %d" , status );
178135 }
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- }
198136 }
199137 }
200138#endif
0 commit comments