fix mac send/receive debug output
This commit is contained in:
@@ -247,17 +247,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// log the received data
|
|
||||||
#ifdef WITH_WIIUSE_DEBUG
|
|
||||||
{
|
|
||||||
printf("[DEBUG] (id %i) RECV: (%x) ", wm->unid, data[0]);
|
|
||||||
int x;
|
|
||||||
for (x = 1; x < length; ++x)
|
|
||||||
printf("%.2x ", data[x]);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called if we are receiving data before completing
|
* This is called if we are receiving data before completing
|
||||||
* the handshaking, hence before calling wiiuse_poll
|
* the handshaking, hence before calling wiiuse_poll
|
||||||
@@ -308,6 +297,19 @@
|
|||||||
WIIUSE_WARNING("Received data was longer than event buffer. Dropping excess bytes.");
|
WIIUSE_WARNING("Received data was longer than event buffer. Dropping excess bytes.");
|
||||||
length = sizeof(wm->event_buf);
|
length = sizeof(wm->event_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// log the received data
|
||||||
|
#ifdef WITH_WIIUSE_DEBUG
|
||||||
|
{
|
||||||
|
printf("[DEBUG] (id %i) RECV: (%x) ", wm->unid, bytes[1]);
|
||||||
|
int x;
|
||||||
|
for (x = 2; x < length; ++x)
|
||||||
|
printf("%.2x ", bytes[x]);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// copy to struct
|
||||||
memcpy(wm->event_buf, bytes, length);
|
memcpy(wm->event_buf, bytes, length);
|
||||||
|
|
||||||
return length;
|
return length;
|
||||||
|
|||||||
@@ -693,12 +693,13 @@ int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) {
|
|||||||
|
|
||||||
#ifdef WITH_WIIUSE_DEBUG
|
#ifdef WITH_WIIUSE_DEBUG
|
||||||
{
|
{
|
||||||
int x = 2;
|
int x;
|
||||||
printf("[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[0], buf[1]);
|
|
||||||
#ifndef WIIUSE_WIN32
|
#ifndef WIIUSE_WIN32
|
||||||
for (; x < len+2; ++x)
|
printf("[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[1], buf[2]);
|
||||||
|
for (x = 3; x < len+2; ++x)
|
||||||
#else
|
#else
|
||||||
for (; x < len+1; ++x)
|
printf("[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[0], buf[1]);
|
||||||
|
for (x = 2; x < len+1; ++x)
|
||||||
#endif
|
#endif
|
||||||
printf("%.2x ", buf[x]);
|
printf("%.2x ", buf[x]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user