2 * fw/sernum.c - ATUSB serial number
4 * Written 2008-2011, 2013 by Werner Almesberger
5 * Copyright 2008-2011, 2013 Werner Almesberger
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
23 static const uint8_t string_descriptor_0[] = {
25 USB_DT_STRING, /* bDescriptorType */
26 LE(USB_LANGID_ENGLISH_US) /* wLANGID[0] */
30 bool sernum_get_descr(uint8_t type, uint8_t index, const uint8_t **reply,
33 if (type != USB_DT_STRING)
37 *reply = string_descriptor_0;
38 *size = sizeof(string_descriptor_0);
41 *reply = board_sernum;
42 *size = sizeof(board_sernum);