diff options
author | Sharvil Nanavati <sharvil@google.com> | 2014-04-26 00:58:15 -0700 |
---|---|---|
committer | Sharvil Nanavati <sharvil@google.com> | 2014-05-08 03:36:20 +0000 |
commit | 1671598d31090ad045f2ca982fbb0a7d486521f3 (patch) | |
tree | eb93c187035a98a2402c154ead7d21967c2e37fe /hci/include | |
parent | d9e5b3490bf41f912823af920cc616e57e0fec28 (diff) | |
download | android_system_bt-1671598d31090ad045f2ca982fbb0a7d486521f3.tar.gz android_system_bt-1671598d31090ad045f2ca982fbb0a7d486521f3.tar.bz2 android_system_bt-1671598d31090ad045f2ca982fbb0a7d486521f3.zip |
Minor cleanup of userial code.
Change-Id: Ib8b094196f2de1515f79f17c4b87eb05f4c113dc
Diffstat (limited to 'hci/include')
-rw-r--r-- | hci/include/userial.h | 81 |
1 files changed, 28 insertions, 53 deletions
diff --git a/hci/include/userial.h b/hci/include/userial.h index d3a5480c7..f04111bbf 100644 --- a/hci/include/userial.h +++ b/hci/include/userial.h @@ -24,61 +24,45 @@ * ******************************************************************************/ -#ifndef USERIAL_H -#define USERIAL_H +#pragma once -/****************************************************************************** -** Constants & Macros -******************************************************************************/ +#include <stdbool.h> +#include <stdint.h> -/**** port IDs ****/ -#define USERIAL_PORT_1 0 -#define USERIAL_PORT_2 1 -#define USERIAL_PORT_3 2 -#define USERIAL_PORT_4 3 -#define USERIAL_PORT_5 4 -#define USERIAL_PORT_6 5 -#define USERIAL_PORT_7 6 -#define USERIAL_PORT_8 7 -#define USERIAL_PORT_9 8 -#define USERIAL_PORT_10 9 -#define USERIAL_PORT_11 10 -#define USERIAL_PORT_12 11 -#define USERIAL_PORT_13 12 -#define USERIAL_PORT_14 13 -#define USERIAL_PORT_15 14 -#define USERIAL_PORT_16 15 -#define USERIAL_PORT_17 16 -#define USERIAL_PORT_18 17 +typedef enum { + USERIAL_PORT_1, + USERIAL_PORT_2, + USERIAL_PORT_3, + USERIAL_PORT_4, + USERIAL_PORT_5, + USERIAL_PORT_6, + USERIAL_PORT_7, + USERIAL_PORT_8, + USERIAL_PORT_9, + USERIAL_PORT_10, + USERIAL_PORT_11, + USERIAL_PORT_12, + USERIAL_PORT_13, + USERIAL_PORT_14, + USERIAL_PORT_15, + USERIAL_PORT_16, + USERIAL_PORT_17, + USERIAL_PORT_18, +} userial_port_t; typedef enum { - USERIAL_OP_INIT, USERIAL_OP_RXFLOW_ON, USERIAL_OP_RXFLOW_OFF, } userial_ioctl_op_t; -/****************************************************************************** -** Type definitions -******************************************************************************/ - -/****************************************************************************** -** Extern variables and functions -******************************************************************************/ - -/****************************************************************************** -** Functions -******************************************************************************/ - /******************************************************************************* ** ** Function userial_init ** ** Description Initializes the userial driver ** -** Returns TRUE/FALSE -** *******************************************************************************/ -uint8_t userial_init(void); +bool userial_init(void); /******************************************************************************* ** @@ -86,10 +70,8 @@ uint8_t userial_init(void); ** ** Description Open Bluetooth device with the port ID ** -** Returns TRUE/FALSE -** *******************************************************************************/ -uint8_t userial_open(uint8_t port); +bool userial_open(userial_port_t port); /******************************************************************************* ** @@ -101,7 +83,7 @@ uint8_t userial_open(uint8_t port); ** copied into p_data. This may be less than len. ** *******************************************************************************/ -uint16_t userial_read(uint16_t msg_id, uint8_t *p_buffer, uint16_t len); +uint16_t userial_read(uint16_t msg_id, uint8_t *p_buffer, uint16_t len); /******************************************************************************* ** @@ -113,7 +95,7 @@ uint16_t userial_read(uint16_t msg_id, uint8_t *p_buffer, uint16_t len); ** may be less than len. ** *******************************************************************************/ -uint16_t userial_write(uint16_t msg_id, uint8_t *p_data, uint16_t len); +uint16_t userial_write(uint16_t msg_id, const uint8_t *p_data, uint16_t len); /******************************************************************************* ** @@ -121,8 +103,6 @@ uint16_t userial_write(uint16_t msg_id, uint8_t *p_data, uint16_t len); ** ** Description Close the userial port ** -** Returns None -** *******************************************************************************/ void userial_close(void); @@ -132,10 +112,5 @@ void userial_close(void); ** ** Description ioctl inteface ** -** Returns None -** *******************************************************************************/ -void userial_ioctl(userial_ioctl_op_t op, void *p_data); - -#endif /* USERIAL_H */ - +void userial_ioctl(userial_ioctl_op_t op); |