12

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.

Piotr Chojnacki
  • 6,771
  • 4
  • 29
  • 65
bertoe
  • 141
  • 2
  • 5

2 Answers2

7

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

NovusMobile
  • 2,210
  • 2
  • 18
  • 45
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.

Bilal Qamar
  • 302
  • 1
  • 2
  • 9