samples/subsys/usb/webusb/src/webusb_serial.c
/**
 * @brief Manipulate line control for UART.
 *
 * @param dev WebUSB Serial device struct
 * @param ctrl The line control to be manipulated
 * @param val Value to set the line control
 *
 * @return 0 if successful, failed otherwise.
 */
@brief Manipulate line control for UART.
@param dev WebUSB Serial device struct
@param ctrl The line control to be manipulated
@param val Value to set the line control

@return 0 if successful, failed otherwise.
@brief Manipulate line control for UART . @param dev WebUSB Serial device struct @param ctrl The line control to be manipulated @param val Value to set the line control @return 0 if successful failed otherwise .
static int webusb_serial_line_ctrl_get(struct device *dev,
		u32_t ctrl, u32_t *val)
{
	struct webusb_serial_dev_data_t * const dev_data = DEV_DATA(dev);
	switch (ctrl) {
	case LINE_CTRL_BAUD_RATE:
		*val = sys_le32_to_cpu(dev_data->line_coding.dwDTERate);
		return 0;
	case LINE_CTRL_RTS:
		*val =
		    (dev_data->line_state & CDC_CONTROL_LINE_STATE_RTS) ? 1 : 0;
		return 0;
	case LINE_CTRL_DTR:
		*val =
		    (dev_data->line_state & CDC_CONTROL_LINE_STATE_DTR) ? 1 : 0;
		return 0;
	}
	return -ENOTSUP;
}
static int webusb_serial_line_ctrl_get ( struct device * dev , u32_t ctrl , u32_t * val ) { struct webusb_serial_dev_data_t * const dev_data = DEV_DATA ( dev ) ; switch ( ctrl ) { case LINE_CTRL_BAUD_RATE : * val = sys_le32_to_cpu ( dev_data -> line_coding . dwDTERate ) ; return 0 ; case LINE_CTRL_RTS : * val = ( dev_data -> line_state & CDC_CONTROL_LINE_STATE_RTS ) ? 1 : 0 ; return 0 ; case LINE_CTRL_DTR : * val = ( dev_data -> line_state & CDC_CONTROL_LINE_STATE_DTR ) ? 1 : 0 ; return 0 ; } return - ENOTSUP ; }
@brief Manipulate line control for UART.
@brief Manipulate line control for UART .