Skip to content

Commit 0affe39

Browse files
committed
First import from AOSP master
The commit includes a standard Makefile and a test application
1 parent 49289b1 commit 0affe39

28 files changed

+14596
-1
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
all:
2+
make -C reference-ril
3+
make -C tests
4+
5+
clean:
6+
make -C reference-ril clean
7+
make -C tests clean
8+

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
1-
# LinuxAOSPRIL
1+
# Linux AOSP RIL
22
Linux AOSP RIL implementation
3+
4+
For the original parts in this project Copyright (c) 2019 Daniele Palmas <[email protected]>
5+
6+
The project allows building and using AOSP RIL in a standard Linux environment.
7+
8+
## Directories
9+
- Include: include files from AOSP needed to build the library
10+
- reference-ril: AOSP reference-ril source code, customized for building in a standard Linux environment
11+
- tests: simple test applications
12+
13+
## Usage
14+
- To build type make in project root: the output is a shared library inside directory reference-ril and sample application inside directory tests
15+
16+
## Dependencies
17+
libbsd-dev
18+
19+
## Contributors
20+
21+
Daniele Palmas <[email protected]>
22+
23+
## License
24+
25+
For the original parts in this project GPL V3

include/libril/ril_ex.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
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_EX_H_INCLUDED
18+
#define RIL_EX_H_INCLUDED
19+
20+
#include <telephony/ril.h>
21+
#include <telephony/record_stream.h>
22+
23+
#define NUM_ELEMS_SOCKET(a) (sizeof (a) / sizeof (a)[0])
24+
25+
struct ril_event;
26+
27+
void rilEventAddWakeup_helper(struct ril_event *ev);
28+
int blockingWrite_helper(int fd, void* data, size_t len);
29+
30+
enum SocketWakeType {DONT_WAKE, WAKE_PARTIAL};
31+
32+
typedef enum {
33+
RIL_TELEPHONY_SOCKET,
34+
RIL_SAP_SOCKET
35+
} RIL_SOCKET_TYPE;
36+
37+
typedef struct SocketListenParam {
38+
RIL_SOCKET_ID socket_id;
39+
int fdListen;
40+
int fdCommand;
41+
const char* processName;
42+
struct ril_event* commands_event;
43+
struct ril_event* listen_event;
44+
void (*processCommandsCallback)(int fd, short flags, void *param);
45+
RecordStream *p_rs;
46+
RIL_SOCKET_TYPE type;
47+
} SocketListenParam;
48+
49+
#endif

include/telephony/librilutils.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (C) 2013 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 LIBRILUTILS_H
18+
#define LIBRILUTILS_H
19+
20+
#include <stdint.h>
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
/**
27+
* Return system time in nanos.
28+
*
29+
* This is a monotonicly increasing clock and
30+
* return the same value as System.nanoTime in java.
31+
*/
32+
uint64_t ril_nano_time();
33+
34+
#ifdef __cplusplus
35+
}
36+
#endif
37+
38+
#endif // LIBRILUTILS_H

include/telephony/record_stream.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (C) 2006 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+
/*
18+
* A simple utility for reading fixed records out of a stream fd
19+
*/
20+
21+
#ifndef _LIBRIL_RECORD_STREAM_H
22+
#define _LIBRIL_RECORD_STREAM_H
23+
24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
28+
29+
typedef struct RecordStream RecordStream;
30+
31+
extern RecordStream *record_stream_new(int fd, size_t maxRecordLen);
32+
extern void record_stream_free(RecordStream *p_rs);
33+
34+
extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord,
35+
size_t *p_outRecordLen);
36+
37+
#ifdef __cplusplus
38+
}
39+
#endif
40+
41+
42+
#endif /*_LIBRIL_RECORD_STREAM_H*/
43+

0 commit comments

Comments
 (0)