aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli.c17
-rw-r--r--src/sample_cli.c19
2 files changed, 19 insertions, 17 deletions
diff --git a/src/cli.c b/src/cli.c
deleted file mode 100644
index 138410f..0000000
--- a/src/cli.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include<stdio.h>
-#include "razerdevice.h"
-#include "razerkbd_driver.h"
-
-int main(int argc, const char * argv[]) {
-
- IOUSBDeviceInterface **dev = getRazerUSBDeviceInterface(0);
- printf("Getting Razer usb device\n");
-
- if (dev == NULL) {
- printf("No device found\n");
- return -1; // Assume appropriate error message displayed during the lookup
- }
-
- return 0;
-
-}
diff --git a/src/sample_cli.c b/src/sample_cli.c
new file mode 100644
index 0000000..5236c23
--- /dev/null
+++ b/src/sample_cli.c
@@ -0,0 +1,19 @@
+#include<stdio.h>
+#include "razerdevice.h"
+#include "razerkbd_driver.h"
+
+int main(int argc, const char * argv[]) {
+ RazerDevices allDevices = getAllRazerDevices();
+ RazerDevice *razerDevices = allDevices.devices;
+
+ printf("%d Razer device(s) found:\n", allDevices.size);
+
+ for (int i = 0; i < allDevices.size; i++) {
+ RazerDevice device = razerDevices[i];
+ printf("%#06x\n", device.productId);
+ }
+
+ closeAllRazerDevices(allDevices);
+ return 0;
+
+}