blob: 45f9d4ffa1c8c97d154b99c044e72bdcb8a1ed84 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/* Copyright Statement:
2 *
3 * This software/firmware and related documentation ("MediaTek Software") are
4 * protected under relevant copyright laws. The information contained herein
5 * is confidential and proprietary to MediaTek Inc. and/or its licensors.
6 * Without the prior written permission of MediaTek inc. and/or its licensors,
7 * any reproduction, modification, use or disclosure of MediaTek Software,
8 * and information contained herein, in whole or in part, shall be strictly prohibited.
9 */
10/* MediaTek Inc. (C) 2010. All rights reserved.
11 *
12 * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
13 * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
14 * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
15 * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
18 * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
19 * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
20 * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
21 * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
22 * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
23 * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
24 * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
25 * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
26 * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
27 * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
28 * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
29 * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
30 *
31 * The following software/firmware and/or related documentation ("MediaTek Software")
32 * have been modified by MediaTek Inc. All revisions are subject to any receiver's
33 * applicable license agreements with MediaTek Inc.
34 */
35#ifndef __ATCI__
36#define __ATCI__
37
38#include "atci_common.h"
39
40#define PHONE_NUMBER_LENGTH 256
41//#define SPI_URI_LENGTH 256
42#define ATCI_SERVER_SOCKET "/dev/socket/atci_server_socket"
43#define SOCKET_BUF_SIZE 1024
44#if ATCI_ENABLE_RESPONSE
45#define RESPONSE_BUF_SIZE 512
46#endif
47#define COMMAND_LENGTH 1024
48#define ATCI_MAX_ARGS 10
49#define RIL_REQUEST_STRING_LENGTH 128
50#define TELEPHONY_REQUEST_BASE 0
51#define TELEPHONY_RESPONSE_BASE 1000
52
53#define TELEPHONY_REQUEST_SET_CALL_FORWARD (TELEPHONY_REQUEST_BASE + 1)
54#define TELEPHONY_REQUEST_SET_CALL_WAITING (TELEPHONY_REQUEST_BASE + 2)
55#define TELEPHONY_REQUEST_SET_CALL_BARRING (TELEPHONY_REQUEST_BASE + 3)
56#define TELEPHONY_REQUEST_DIAL (TELEPHONY_REQUEST_BASE + 4)
57#define TELEPHONY_REQUEST_DROP_CONF_CALL_MEMBER (TELEPHONY_REQUEST_BASE + 5)
58#define TELEPHONY_REQUEST_FLIGHT (TELEPHONY_REQUEST_BASE + 6)
59#define TELEPHONY_REQUEST_SET_MUTE (TELEPHONY_REQUEST_BASE + 7)
60#define TELEPHONY_REQUEST_MERGE_CONF_CALLS (TELEPHONY_REQUEST_BASE + 8)
61#define TELEPHONY_REQUEST_CREATE_IMS_CONF_CALL (TELEPHONY_REQUEST_BASE +9)
62#define TELEPHONY_REQUEST_DIAL_WITH_SIP_URI (TELEPHONY_REQUEST_BASE +10)
63
64#define TELEPHONY_RESPONSE_FLIGHT (TELEPHONY_RESPONSE_BASE + 1)
65
66#if ATCI_ENABLE_RESPONSE
67extern char Respose_buf[RESPONSE_BUF_SIZE];
68#endif
69//request struct
70typedef struct {
71 int status;
72 int reason;
73 int service_class;
74 int toa;
75 char number[PHONE_NUMBER_LENGTH];
76 int time_seconds;
77} telephonyRequestSetCallForward;
78
79typedef struct {
80 int status;
81 int service_class;
82} telephonyRequestSetCallWaiting;
83
84typedef struct {
85 int status;
86 char facility[32];
87 char password[32];
88 int serviceClass;
89 char aid[32];
90} telephonyRequestSetCallBarring;
91
92typedef struct {
93 int clir;
94 char phonyNumber[PHONE_NUMBER_LENGTH];
95} telephonyRequestDial;
96
97typedef struct {
98 int confCallID;
99 char phonyNumber[PHONE_NUMBER_LENGTH];
100 int callIDToAdd;
101} telephonyRequestDropConfCallMember;
102
103typedef struct {
104 unsigned int flightModeOn;
105} telephonyRequestFlight;
106
107typedef struct {
108 int isMute;
109} telephonyRequestSetMute;
110
111typedef struct {
112 int reserve;
113} telephonyRequestCreateIMSConfCall;
114
115//response struct
116typedef struct {
117 int ret;
118} telephonyResponseFlight;
119
120#if 1 //socket data protocol.
121typedef struct {
122 int requestId;
123 int datalen;
124 char * data;
125} socketData;
126#endif
127
128#ifdef ATCI_PARSE
129
130#define MAX(a,b) ((a)>(b)?(a):(b))
131
132typedef enum {
133 INCH_TYPE_MIN = 0,
134 INCH_TYPE_UART,
135 INCH_TYPE_CHAR,
136 INCH_TYPE_UTCP,
137 INCH_TYPE_MAX
138} atci_inch_type_e;
139
140typedef struct atci_num_resp_s {
141 char resp[20];
142 int num;
143} atci_num_resp_t;
144
145void sendAtciRequest(int request, char* reqStr, int argc, char** argv);
146#endif
147
148void ATCIResponse(int token, int error, char* data, int reqNum);
149
150void * StartATCISocket(void *param);
151#endif