Files
Upsilon/ion/src/device/usb/stack/device_descriptor.cpp
Léa Saviot 94e1e2cff5 [usb] Cleaned the way descriptors are copied on the transfer buffer.
Change-Id: Ia6a6372340300d4144fd699f3d318c8d22a49492
2018-04-06 14:31:45 +02:00

30 lines
645 B
C++

#include "device_descriptor.h"
namespace Ion {
namespace USB {
namespace Device {
void DeviceDescriptor::push(Channel * c) const {
Descriptor::push(c);
c->push(m_bcdUSB);
c->push(m_bDeviceClass);
c->push(m_bDeviceSubClass);
c->push(m_bDeviceProtocol);
c->push(m_bMaxPacketSize0);
c->push(m_idVendor);
c->push(m_idProduct);
c->push(m_bcdDevice);
c->push(m_iManufacturer);
c->push(m_iProduct);
c->push(m_iSerialNumber);
c->push(m_bNumConfigurations);
}
uint8_t DeviceDescriptor::bLength() const {
return Descriptor::bLength() + sizeof(uint16_t) + 4*sizeof(uint8_t) + 3*sizeof(uint16_t) + 4*sizeof(uint8_t);
}
}
}
}