xref: /aosp_15_r20/hardware/ril/include/libril/ril_ex.h (revision 062a843b36e31144e02d312b6b2de34642e6750e)
1*062a843bSAndroid Build Coastguard Worker /*
2*062a843bSAndroid Build Coastguard Worker * Copyright (C) 2014 The Android Open Source Project
3*062a843bSAndroid Build Coastguard Worker *
4*062a843bSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*062a843bSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*062a843bSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*062a843bSAndroid Build Coastguard Worker *
8*062a843bSAndroid Build Coastguard Worker *     http://www.apache.org/licenses/LICENSE-2.0
9*062a843bSAndroid Build Coastguard Worker *
10*062a843bSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*062a843bSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*062a843bSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*062a843bSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*062a843bSAndroid Build Coastguard Worker * limitations under the License.
15*062a843bSAndroid Build Coastguard Worker */
16*062a843bSAndroid Build Coastguard Worker 
17*062a843bSAndroid Build Coastguard Worker #ifndef RIL_EX_H_INCLUDED
18*062a843bSAndroid Build Coastguard Worker #define RIL_EX_H_INCLUDED
19*062a843bSAndroid Build Coastguard Worker 
20*062a843bSAndroid Build Coastguard Worker #include <telephony/ril.h>
21*062a843bSAndroid Build Coastguard Worker #include <telephony/record_stream.h>
22*062a843bSAndroid Build Coastguard Worker 
23*062a843bSAndroid Build Coastguard Worker #define NUM_ELEMS_SOCKET(a)     (sizeof (a) / sizeof (a)[0])
24*062a843bSAndroid Build Coastguard Worker 
25*062a843bSAndroid Build Coastguard Worker struct ril_event;
26*062a843bSAndroid Build Coastguard Worker 
27*062a843bSAndroid Build Coastguard Worker void rilEventAddWakeup_helper(struct ril_event *ev);
28*062a843bSAndroid Build Coastguard Worker int blockingWrite_helper(int fd, void* data, size_t len);
29*062a843bSAndroid Build Coastguard Worker 
30*062a843bSAndroid Build Coastguard Worker enum SocketWakeType {DONT_WAKE, WAKE_PARTIAL};
31*062a843bSAndroid Build Coastguard Worker 
32*062a843bSAndroid Build Coastguard Worker typedef enum {
33*062a843bSAndroid Build Coastguard Worker     RIL_TELEPHONY_SOCKET,
34*062a843bSAndroid Build Coastguard Worker     RIL_SAP_SOCKET
35*062a843bSAndroid Build Coastguard Worker } RIL_SOCKET_TYPE;
36*062a843bSAndroid Build Coastguard Worker 
37*062a843bSAndroid Build Coastguard Worker typedef struct SocketListenParam {
38*062a843bSAndroid Build Coastguard Worker     RIL_SOCKET_ID socket_id;
39*062a843bSAndroid Build Coastguard Worker     int fdListen;
40*062a843bSAndroid Build Coastguard Worker     int fdCommand;
41*062a843bSAndroid Build Coastguard Worker     const char* processName;
42*062a843bSAndroid Build Coastguard Worker     struct ril_event* commands_event;
43*062a843bSAndroid Build Coastguard Worker     struct ril_event* listen_event;
44*062a843bSAndroid Build Coastguard Worker     void (*processCommandsCallback)(int fd, short flags, void *param);
45*062a843bSAndroid Build Coastguard Worker     RecordStream *p_rs;
46*062a843bSAndroid Build Coastguard Worker     RIL_SOCKET_TYPE type;
47*062a843bSAndroid Build Coastguard Worker } SocketListenParam;
48*062a843bSAndroid Build Coastguard Worker 
49*062a843bSAndroid Build Coastguard Worker #endif
50