From da7075f6cfd7f68a45611a72ccfa53295985d8c0 Mon Sep 17 00:00:00 2001 From: Ivan Epifanov Date: Wed, 15 May 2024 21:47:12 +0300 Subject: [PATCH] Fix bt addr report --- module/include/vivid-user.h | 2 +- module/src/main.c | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/module/include/vivid-user.h b/module/include/vivid-user.h index e58d9d2..fe5b9c5 100644 --- a/module/include/vivid-user.h +++ b/module/include/vivid-user.h @@ -8,7 +8,7 @@ extern "C" { #endif - #define VIVID_MODULE_API 3 + #define VIVID_MODULE_API 4 void vividStart(void); void vividStop(void); diff --git a/module/src/main.c b/module/src/main.c index a1f432e..fc26fbc 100644 --- a/module/src/main.c +++ b/module/src/main.c @@ -128,17 +128,18 @@ static int sendHidF2Report(uint8_t report_id, uint16_t length) // set operationa { static uint8_t f2_reply[18] __attribute__((aligned(64))) = {0xf2, // report num - 0xff, 0xff, 0x00, - 0x00, 0x06, 0xf5, 0xd7, 0x8b, 0x5d, // model? + 0xff, 0xff, 0x00, - 0x03, 0x50, 0x81, 0xd8, 0x01, 0x8b, 0x00}; // device mac + 0x00, 0x06, 0xf5, 0xd7, 0x8b, 0x5d, // mac + 0x00, + 0x03, 0x50, 0x81, 0xd8, 0x01, 0x8b, 0x00}; // model? host mac? - f2_reply[11] = g_my_mac[0]; - f2_reply[12] = g_my_mac[1]; - f2_reply[13] = g_my_mac[2]; - f2_reply[14] = g_my_mac[3]; - f2_reply[15] = g_my_mac[4]; - f2_reply[16] = g_my_mac[5]; + f2_reply[4] = g_my_mac[0]; + f2_reply[5] = g_my_mac[1]; + f2_reply[6] = g_my_mac[2]; + f2_reply[7] = g_my_mac[3]; + f2_reply[8] = g_my_mac[4]; + f2_reply[9] = g_my_mac[5]; static SceUdcdDeviceRequest req = {.endpoint = &endpoints[0], .data = f2_reply, @@ -461,7 +462,7 @@ static int processUdcdRequest(int recipient, int arg, SceUdcdEP0DeviceRequest *r uint8_t req_type = req->bmRequestType & USB_CTRLTYPE_TYPE_MASK; uint8_t req_recipient = req->bmRequestType & USB_CTRLTYPE_REC_MASK; -// ksceKernelPrintf("got request: dir: 0x%02x, type: 0x%02x, recp: 0x%02x, wValue: 0x%04x\n", req_dir, req_type, req_recipient, req->wValue); +// ksceKernelPrintf("got request: dir: 0x%02x, type: 0x%02x, recp: 0x%02x, wValue: 0x%04x, wLength: 0x%04x\n", req_dir, req_type, req_recipient, req->wValue, req->wLength); // TODO: untangle this shit if (req_dir == USB_CTRLTYPE_DIR_DEVICE2HOST)