@@ -211,11 +211,18 @@ bool ProcessCommand(CommandLine *cmd) {
211211 // Wacom Intuos (490)
212212 if (cmd->GetStringLower (0 , " " ) == " wacomintuos" ) {
213213 tablet->settings .type = TabletSettings::TypeWacomIntuos;
214+ }
214215
215216 // Wacom CTL-4100
216- } else if (cmd->GetStringLower (0 , " " ) == " wacom4100" ) {
217+ else if (cmd->GetStringLower (0 , " " ) == " wacom4100" ) {
217218 tablet->settings .type = TabletSettings::TypeWacom4100;
218219 }
220+
221+ // Wacom Drivers
222+ else if (cmd->GetStringLower (0 , " " ) == " wacomdrivers" ) {
223+ tablet->settings .type = TabletSettings::TypeWacomDrivers;
224+ }
225+
219226 LOG_INFO (" Tablet type = %d\n " , tablet->settings .type );
220227 }
221228
@@ -245,34 +252,54 @@ bool ProcessCommand(CommandLine *cmd) {
245252
246253
247254 //
248- // Send Feature Report
255+ // Set Feature Report
249256 //
250- else if ((cmd->is (" FeatureReport " ) || cmd->is (" Feature" )) && cmd->valueCount > 0 ) {
257+ else if ((cmd->is (" SetFeature " ) || cmd->is (" Feature" )) && cmd->valueCount > 1 ) {
251258 if (tablet == NULL ) return false ;
252259 if (tablet->hidDevice == NULL ) return false ;
253- int length = cmd->valueCount ;
260+ int length = cmd->GetInt ( 0 , 1 ) ;
254261 BYTE *buffer = new BYTE[length];
255262 for (int i = 0 ; i < length; i++) {
256- buffer[i] = cmd->GetInt (i, 0 );
263+ buffer[i] = cmd->GetInt (i + 1 , 0 );
257264 }
265+ LOG_INFOBUFFER (buffer, length, " Set Feature Report (%d): " , length);
258266 tablet->hidDevice ->SetFeature (buffer, length);
259- LOG_INFOBUFFER (buffer, length, " Tablet HID Feature Report: " );
267+ LOG_INFO ( " HID Feature set! \n " );
260268 delete buffer;
261269 }
262270
271+ //
272+ // Get Feature Report
273+ //
274+ else if (cmd->is (" GetFeature" ) && cmd->valueCount > 1 ) {
275+ if (tablet == NULL ) return false ;
276+ if (tablet->hidDevice == NULL ) return false ;
277+ int length = cmd->GetInt (0 , 1 );
278+ BYTE *buffer = new BYTE[length];
279+ for (int i = 0 ; i < length; i++) {
280+ buffer[i] = cmd->GetInt (i + 1 , 0 );
281+ }
282+ LOG_INFOBUFFER (buffer, length, " Get Feature Report (%d): " , length);
283+ tablet->hidDevice ->GetFeature (buffer, length);
284+ LOG_INFOBUFFER (buffer, length, " Result Feature Report (%d): " , length);
285+ delete buffer;
286+ }
287+
288+
263289 //
264290 // Send Output Report
265291 //
266- else if ((cmd->is (" OutputReport" ) || cmd->is (" Report" )) && cmd->valueCount > 0 ) {
292+ else if ((cmd->is (" OutputReport" ) || cmd->is (" Report" )) && cmd->valueCount > 1 ) {
267293 if (tablet == NULL ) return false ;
268294 if (tablet->hidDevice == NULL ) return false ;
269- int length = cmd->valueCount ;
295+ int length = cmd->GetInt ( 0 , 1 ) ;
270296 BYTE *buffer = new BYTE[length];
271297 for (int i = 0 ; i < length; i++) {
272- buffer[i] = cmd->GetInt (i, 0 );
298+ buffer[i] = cmd->GetInt (i + 1 , 0 );
273299 }
300+ LOG_INFOBUFFER (buffer, length, " Sending HID Report: " );
274301 tablet->hidDevice ->Write (buffer, length);
275- LOG_INFOBUFFER (buffer, length, " Tablet HID Output Report: " );
302+ LOG_INFO ( " Report sent! \n " );
276303 delete buffer;
277304 }
278305
0 commit comments