From a2f768dd5faf13e770a454cda623eda068115394 Mon Sep 17 00:00:00 2001 From: laforge Date: Wed, 4 Oct 2006 17:55:17 +0000 Subject: - add read of serial number via usb git-svn-id: https://svn.openpcd.org:2342/trunk@260 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- firmware/src/os/usbcmd_generic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'firmware/src/os') diff --git a/firmware/src/os/usbcmd_generic.c b/firmware/src/os/usbcmd_generic.c index 386692b..c26daf7 100644 --- a/firmware/src/os/usbcmd_generic.c +++ b/firmware/src/os/usbcmd_generic.c @@ -32,11 +32,16 @@ static int gen_usb_rx(struct req_ctx *rctx) led_switch(poh->reg, poh->val); break; case OPENPCD_CMD_GET_SERIAL: - DEBUGP("GET SERIAL "); + DEBUGP("GET SERIAL("); poh->flags |= OPENPCD_FLAG_RESPOND; #ifdef PCD rctx->tot_len += 4; - rc632_get_serial(NULL, (u_int32_t *)poh->data); + if (rc632_get_serial(NULL, (u_int32_t *)poh->data) < 0) { + DEBUGP("ERROR) "); + return USB_ERR(USB_ERR_CMD_NOT_IMPL); + } + + DEBUGP("%s) ", hexdump(poh->data, 4)); #else /* FIXME: where to get serial in PICC case */ return USB_ERR(USB_ERR_CMD_NOT_IMPL); -- cgit v1.2.3