Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ceaab0be authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "legacy: Truncate hci/include/userial"

parents 33f9de07 a0e394ab
Loading
Loading
Loading
Loading
+7 −50
Original line number Original line Diff line number Diff line
@@ -16,56 +16,13 @@
 *
 *
 ******************************************************************************/
 ******************************************************************************/


// This module manages the serial port over which HCI commands
#pragma message "This header file userial.h is no longer supported"
// and data are sent/received.
#pragma message "Please update to remove these declarations"


#pragma once
#pragma once


#include <stdbool.h>
//     Currently still included by:
#include <stdint.h>
//         hardware/broadcom/libbt/include/userial_vendor.h

//         vendor/amlogic/common/wifi_bt/bluetooth/realtek/rtkbt/code/libbt-vendor/include/userial_vendor.h
typedef enum {
//         vendor/amlogic/common/wifi_bt/bluetooth/broadcom/vendor/include/userial_vendor.h
  USERIAL_PORT_1,
//         vendor/amlogic/common/wifi_bt/bluetooth/amlogic/aml_libbt-vendor/include/userial_vendor.h
  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;

// Initializes the userial module. This function should only be called once.
// It returns true if the module was initialized, false if there was an error.
bool userial_init(void);

// Opens the given serial port. Returns true if successful, false otherwise.
// Once this function is called, the userial module will begin producing
// buffers from data read off the serial port. If you wish to pause the
// production of buffers, call |userial_pause_reading|. You can then resume
// by calling |userial_resume_reading|. This function returns true if the
// serial port was successfully opened and buffer production has started. It
// returns false if there was an error.
bool userial_open(userial_port_t port);
void userial_close(void);
void userial_close_reader(void);

// Reads a maximum of |len| bytes from the serial port into |p_buffer|.
// This function returns the number of bytes actually read, which may be
// less than |len|. This function will not block.
uint16_t userial_read(uint16_t msg_id, uint8_t* p_buffer, uint16_t len);

// Writes a maximum of |len| bytes from |p_data| to the serial port.
// This function returns the number of bytes actually written, which may be
// less than |len|. This function may block.
uint16_t userial_write(uint16_t msg_id, const uint8_t* p_data, uint16_t len);