Android Radio Interface Layer (RIL) and /dev/
Asked Answered
B

2

13

Does anyone know how the RIL (/hardware/reference/reference-ril/) determines what gets mounted in /dev/ when the baseband radio gets initiated?

In older phones and in other documentation, GSM phones use /dev/smd0. Not all phones use /dev/smd0. I am trying to determine a way to find out what gets mounted regardless of the type of radio and vendor.

If someone can specifically identify where in the /hardware/reference/reference-ril/ I can see where this is set and where it's pulling the info from upon initialization, that would be perfect.

Bleeder answered 13/12, 2011 at 21:13 Comment(0)
H
6

RIL is in your application Framework.

if you want to see the RIL and Implements the functionality with use of command prompt it is done. There is below command :

void (*RIL_RequestFunc) (int request, void *data, size_t datalen, RIL_Token t);

I found this from here:

you are serious about this please go through link: RIL Study LInk

If you want to know about example : GIT HUB

Hoofer answered 7/2, 2012 at 6:29 Comment(0)
B
0

It actually depends on what interface you are using to connect. You might use USB, UART or SPI interface to connect the upper layer with the modem. The paramter passed in the RIL_Init function determines the device you are trying to connect to. If you want to know specifically where this is done, please see the RIL_Init function in reference-ril.c.

const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv)

{

int ret;

int fd = -1;
int opt;
pthread_attr_t attr;

s_rilenv = env;

while ( -1 != (opt = getopt(argc, argv, "p:d:s:"))) {
    switch (opt) {
        case 'p':
            s_port = atoi(optarg);
            if (s_port == 0) {
                usage(argv[0]);
                return NULL;
            }
            RLOGI("Opening loopback port %d\n", s_port);
        break;

        case 'd':
            s_device_path = optarg;
            RLOGI("Opening tty device %s\n", s_device_path);
        break;

        case 's':
            s_device_path   = optarg;
            s_device_socket = 1;
            RLOGI("Opening socket %s\n", s_device_path);
        break;

        default:
            usage(argv[0]);
            return NULL;
    }
}

if (s_port < 0 && s_device_path == NULL) {
    usage(argv[0]);
    return NULL;
}

sMdmInfo = calloc(1, sizeof(ModemInfo));
if (!sMdmInfo) {
    RLOGE("Unable to alloc memory for ModemInfo");
    return NULL;
}
pthread_attr_init (&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ret = pthread_create(&s_tid_mainloop, &attr, mainLoop, NULL);

return &s_callbacks;

}

I hope things are clear now.

Borgerhout answered 4/8, 2015 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.