rfcomm: use #defines instead of rpn_flow_control_t

This commit is contained in:
Matthias Ringwald 2021-09-03 15:04:29 +02:00
parent b196150f5b
commit 874776bf51
3 changed files with 8 additions and 10 deletions

View File

@ -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

View File

@ -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;

View File

@ -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