blob: 53b00c9d9883597a2289e38c3407e6f4ffb1e2c1 [file] [log] [blame]
Dheeraj Shetty27976c42014-07-02 21:27:57 +02001/*
2* Copyright (C) 2014 The Android Open Source Project
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17#ifndef RIL_SOCKET_H_INCLUDED
18#define RIL_SOCKET_H_INCLUDED
Colin Crossb8ade032015-12-16 14:15:42 -080019#include <libril/ril_ex.h>
Dheeraj Shetty27976c42014-07-02 21:27:57 +020020#include "rilSocketQueue.h"
21#include <ril_event.h>
22
Dheeraj Shetty27976c42014-07-02 21:27:57 +020023/**
24 * Abstract socket class representing sockets in rild.
25 * <p>
26 * This class performs the following functions :
27 * <ul>
28 * <li> Start socket listen.
29 * <li> Handle socket listen and command callbacks.
30 * </ul>
31 */
32class RilSocket {
33 protected:
34
35 /**
36 * Socket name.
37 */
38 const char* name;
39
40 /**
41 * Socket id.
42 */
43 RIL_SOCKET_ID id;
44
Dheeraj Shetty27976c42014-07-02 21:27:57 +020045 public:
46
47 /**
48 * Constructor.
49 *
50 * @param Socket name.
51 * @param Socket id.
52 */
53 RilSocket(const char* socketName, RIL_SOCKET_ID socketId) {
54 name = socketName;
55 id = socketId;
56 }
57
58 /**
Amit Mahajanc2c71852016-11-29 16:48:54 -080059 * Get socket id.
60 *
61 * @return RIL_SOCKET_ID socket id.
62 */
Amit Mahajan4cc508a2017-03-22 11:25:51 -070063 RIL_SOCKET_ID getSocketId(void) {
64 return id;
65 }
Amit Mahajanc2c71852016-11-29 16:48:54 -080066
Dheeraj Shetty27976c42014-07-02 21:27:57 +020067 virtual ~RilSocket(){}
Dheeraj Shetty27976c42014-07-02 21:27:57 +020068};
69
Dheeraj Shetty27976c42014-07-02 21:27:57 +020070#endif