• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 2009-2018 Realtek Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /******************************************************************************
20  *
21  *  Filename:      userial_vendor.h
22  *
23  *  Description:   Contains vendor-specific definitions used in serial port
24  *                 controls
25  *
26  ******************************************************************************/
27 
28 #ifndef RTK_SOCKET_H
29 #define RTK_SOCKET_H
30 
31 #include "bt_vendor_rtk.h"
32 #include "userial.h"
33 #include <assert.h>
34 #include <sys/select.h>
35 #include <sys/socket.h>
36 #include <poll.h>
37 #include <sys/prctl.h>
38 #include <sys/un.h>
39 
40 #ifdef CONFIG_SCO_OVER_HCI
41 #define SCO_CTRL_PATH "/data/misc/bluedroid/.sco_ctrl"
42 #define SCO_DATA_PATH "/data/misc/bluedroid/.sco_data"
43 
44 typedef enum
45 {
46     SCO_CTRL_CMD_NONE,
47     SCO_CTRL_CMD_CHECK_READY,
48     SCO_CTRL_CMD_OUT_START,
49     SCO_CTRL_CMD_IN_START,
50     SCO_CTRL_CMD_OUT_STOP,
51     SCO_CTRL_CMD_IN_STOP,
52     SCO_CTRL_CMD_SUSPEND,
53     SCO_CTRL_GET_AUDIO_CONFIG,
54     SCO_CTRL_CMD_OFFLOAD_START,
55     SCO_CTRL_CMD_CLOSE,
56 } tSCO_CTRL_CMD;
57 
58 #define SCO_SAMPLE_RATE_8K 1
59 #define SCO_SAMPLE_RATE_16K 2
60 
61 #endif
62 
63 #define MAX(a, b) ((a) > (b) ? (a) : (b))
64 
65 /******************************************************************************
66 **  Constants & Macros
67 ******************************************************************************/
68 
69 uint32_t Skt_Read(int fd, uint8_t *p_buf, uint32_t len, bool *condition);
70 int Skt_Read_noblock(int fd, uint8_t *p_buf, uint32_t len);
71 bool Skt_Send(int fd, uint8_t *p_buf, uint16_t msglen);
72 int Skt_Send_noblock(int fd, uint8_t *p_buf, uint16_t msglen);
73 #endif
74