// If you do not bind CDC interface to any UART, and just use bulk IN/OUT, this simple implementation is enough.
static uint8_t lineCoding[7] // <------- add these three lines
// 115200bps, 1stop, no parity, 8bit
= {0x00, 0xC2, 0x01, 0x00, 0x00, 0x00, 0x08
};
static int8_t CDC_Control_FS (uint8_t cmd, uint8_t* pbuf, uint16_t length)
{
/* USER CODE BEGIN 5 */
switch (cmd)
{
...
case CDC_SET_LINE_CODING:
memcpy( lineCoding
, pbuf
, sizeof(lineCoding
) ); // <-- add this line break;
case CDC_GET_LINE_CODING:
memcpy( pbuf
, lineCoding
, sizeof(lineCoding
) ); // <-- add this line break;