From 874776bf515167793fdf9d2c676c92220ffbee81 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 3 Sep 2021 15:04:29 +0200 Subject: [PATCH] rfcomm: use #defines instead of rpn_flow_control_t --- src/bluetooth.h | 14 ++++++-------- src/classic/rfcomm.c | 2 +- src/classic/rfcomm.h | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/bluetooth.h b/src/bluetooth.h index fa364ebae..87cf7c366 100644 --- a/src/bluetooth.h +++ b/src/bluetooth.h @@ -519,14 +519,12 @@ typedef enum rpn_parity { RPN_PARITY_SPACE = 7, } rpn_parity_t; -typedef enum rpn_flow_control { - RPN_FLOW_CONTROL_XONXOFF_ON_INPUT = 1 << 0, - RPN_FLOW_CONTROL_XONXOFF_ON_OUTPUT = 1 << 1, - RPN_FLOW_CONTROL_RTR_ON_INPUT = 1 << 2, - RPN_FLOW_CONTROL_RTR_ON_OUTPUT = 1 << 3, - RPN_FLOW_CONTROL_RTC_ON_INPUT = 1 << 4, - RPN_FLOW_CONTROL_RTC_ON_OUTPUT = 1 << 5, -} rpn_flow_control_t; +#define RPN_FLOW_CONTROL_XONXOFF_ON_INPUT 0x01 +#define RPN_FLOW_CONTROL_XONXOFF_ON_OUTPUT 0x02 +#define RPN_FLOW_CONTROL_RTR_ON_INPUT 0x04 +#define RPN_FLOW_CONTROL_RTR_ON_OUTPUT 0x08 +#define RPN_FLOW_CONTROL_RTC_ON_INPUT 0x10 +#define RPN_FLOW_CONTROL_RTC_ON_OUTPUT 0x20 #define RPN_PARAM_MASK_0_BAUD 0x01 #define RPN_PARAM_MASK_0_DATA_BITS 0x02 diff --git a/src/classic/rfcomm.c b/src/classic/rfcomm.c index f13d6e018..9fce366e8 100644 --- a/src/classic/rfcomm.c +++ b/src/classic/rfcomm.c @@ -2380,7 +2380,7 @@ int rfcomm_send_modem_status(uint16_t rfcomm_cid, uint8_t modem_status){ } // Configure remote port -int rfcomm_send_port_configuration(uint16_t rfcomm_cid, rpn_baud_t baud_rate, rpn_data_bits_t data_bits, rpn_stop_bits_t stop_bits, rpn_parity_t parity, rpn_flow_control_t flow_control){ +int rfcomm_send_port_configuration(uint16_t rfcomm_cid, rpn_baud_t baud_rate, rpn_data_bits_t data_bits, rpn_stop_bits_t stop_bits, rpn_parity_t parity, uint8_t flow_control){ rfcomm_channel_t * channel = rfcomm_channel_for_rfcomm_cid(rfcomm_cid); if (!channel){ return 0; diff --git a/src/classic/rfcomm.h b/src/classic/rfcomm.h index b4fd96acd..0621aca3c 100644 --- a/src/classic/rfcomm.h +++ b/src/classic/rfcomm.h @@ -390,7 +390,7 @@ int rfcomm_send_modem_status(uint16_t rfcomm_cid, uint8_t modem_status); * @param parity * @param flow_control */ -int rfcomm_send_port_configuration(uint16_t rfcomm_cid, rpn_baud_t baud_rate, rpn_data_bits_t data_bits, rpn_stop_bits_t stop_bits, rpn_parity_t parity, rpn_flow_control_t flow_control); +int rfcomm_send_port_configuration(uint16_t rfcomm_cid, rpn_baud_t baud_rate, rpn_data_bits_t data_bits, rpn_stop_bits_t stop_bits, rpn_parity_t parity, uint8_t flow_control); /** * @brief Query remote port