summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-10-04 17:55:17 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-10-04 17:55:17 +0000
commita2f768dd5faf13e770a454cda623eda068115394 (patch)
treed85ac7d71f8b174380ee0f3ecda9c02c237d8215
parent6a189e6160b55368f9fcbf1982aa870e7399da6e (diff)
- add read of serial number via usb
git-svn-id: https://svn.openpcd.org:2342/trunk@260 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r--firmware/src/os/usbcmd_generic.c9
1 files changed, 7 insertions, 2 deletions
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);
personal git repositories of Harald Welte. Your mileage may vary