Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

modify usb config to include stampS3

Geo6f2bd2f48b2d
diff --git a/src/Factories/usbFactory.cpp b/src/Factories/usbFactory.cpp
index 36da4880..0e74c318 100644
--- a/src/Factories/usbFactory.cpp
+++ b/src/Factories/usbFactory.cpp
@@ -1,15 +1,15 @@
#include "Factories/UsbFactory.h"
-#if defined(DEVICE_CARDPUTER)
- #include <Services/UsbCardputerService.h>
- #include <Controllers/UsbCardputerController.h>
-#endif
-
#if defined(DEVICE_M5STICK)
#include <Services/UsbM5StickService.h>
#include <Controllers/UsbM5StickController.h>
+#else
+ // Fallback for all other devices: Cardputer, StampS3, etc.
+ #include <Services/UsbS3Service.h>
+ #include <Controllers/UsbS3Controller.h>
#endif
+
UsbComponents UsbFactory::create(ITerminalView& terminalView, IInput& terminalInput) {
#if defined(DEVICE_M5STICK)
static ArgTransformer argTransformer;
@@ -23,12 +23,11 @@ UsbComponents UsbFactory::create(ITerminalView& terminalView, IInput& terminalIn
usbService,
usbController
};
-
-#elif defined(DEVICE_CARDPUTER)
+#else
static ArgTransformer argTransformer;
static UserInputManager userInputManager(terminalView, terminalInput, argTransformer);
- static UsbCardputerService usbService;
- static UsbCardputerController usbController(terminalView, terminalInput, usbService, argTransformer, userInputManager);
+ static UsbS3Service usbService;
+ static UsbS3Controller usbController(terminalView, terminalInput, usbService, argTransformer, userInputManager);
return UsbComponents{
argTransformer,
@@ -36,8 +35,5 @@ UsbComponents UsbFactory::create(ITerminalView& terminalView, IInput& terminalIn
usbService,
usbController
};
-
-#else
- #error "No supported DEVICE defined for USBFactory"
#endif
}