PC := PKG_CONFIG_PATH=/home/mj/tmp/bsb/root/lib/pkgconfig pkg-config
USB_CFLAGS := $(shell $(PC) --cflags libusb-1.0)
USB_LDFLAGS := $(shell $(PC) --libs libusb-1.0)
+UCW_CFLAGS := $(shell $(PC) --cflags libucw)
+UCW_LDFLAGS := $(shell $(PC) --libs libucw)
-CFLAGS=$(USB_CFLAGS) $(CURL_CFLAGS) -std=gnu1x -O2 -Wall -Wextra -Wno-parentheses
-LDFLAGS=$(USB_LDFLAGS) $(CURL_LDFLAGS)
+CFLAGS=$(USB_CFLAGS) $(UCW_CFLAGS) -std=gnu1x -O2 -Wall -Wextra -Wno-parentheses
+LDFLAGS=$(USB_LDFLAGS) $(UCW_LDFLAGS) -lmosquitto
all: burrow-bsb
static void show_packet(byte *pkt, uint len)
{
+ time_t now = time(NULL);
+ struct tm *tm = localtime(&now);
+ char timebuf[64];
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm);
+ printf("%s ", timebuf);
+
if (!len) {
printf("ERROR: Received empty frame!\n");
return;
len--;
if (!len) {
- printf("Transmit status: %u\n", status);
+ printf("ERROR: Transmit status: %u\n", status);
return;
}
-#if 1
+#if 0
printf(": [%d]", status);
for (uint i=0; i<len; i++)
printf(" %02x", pkt[i]);
// usb_error("Receive failed: error %d", received);
// continue;
} else {
- printf("Send OK: %d bytes\n", received);
+ // printf("Send OK: %d bytes\n", received);
}
last_query = now;
}