diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2019-07-25 18:49:35 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2019-07-25 18:52:48 +0200 |
commit | 881e7708d109b47dcdc2c1e963b28f215c109fc6 (patch) | |
tree | a93da5893bf82c6de1b06e74b6cd4891ce915dae | |
parent | f38fb9ea52181b2551ddc186f1a58e7fb7a3fad6 (diff) | |
download | presentations-881e7708d109b47dcdc2c1e963b28f215c109fc6.tar.gz presentations-881e7708d109b47dcdc2c1e963b28f215c109fc6.tar.bz2 presentations-881e7708d109b47dcdc2c1e963b28f215c109fc6.zip |
July 2019 Replicant meeting: modems: Introduction: cosmetics improvements
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r-- | Replicant_contributors_meeting_27_28_July_2019_Paris_France/modems/Replicant_and_modems_Introduction.tex | 101 |
1 files changed, 59 insertions, 42 deletions
diff --git a/Replicant_contributors_meeting_27_28_July_2019_Paris_France/modems/Replicant_and_modems_Introduction.tex b/Replicant_contributors_meeting_27_28_July_2019_Paris_France/modems/Replicant_and_modems_Introduction.tex index 474d4b9..a5317cf 100644 --- a/Replicant_contributors_meeting_27_28_July_2019_Paris_France/modems/Replicant_and_modems_Introduction.tex +++ b/Replicant_contributors_meeting_27_28_July_2019_Paris_France/modems/Replicant_and_modems_Introduction.tex @@ -105,6 +105,10 @@ < OK \end{lstlisting} +\begin{frame} + \center{More complex example} +\end{frame} + \begin{lstlisting}[style=terminal] # use verbose error values, report registration > AT+CMEE=2;+CREG=1 @@ -141,6 +145,10 @@ \center{More realistic example} \end{frame} +\begin{frame} + \center{Standard not respected} +\end{frame} + \begin{lstlisting}[style=terminal] # 0707: +CSQ: <rssi>,<ber> # MDM6200/6600: +CSQ: <N> @@ -150,6 +158,10 @@ < +CRING: VOICE/06050403002 \end{lstlisting} +\begin{frame} + \center{Vendor specific commands} +\end{frame} + \begin{lstlisting}[style=terminal] # Enable noise cancelation on the OpenMoko > AT%N0105 @@ -200,18 +212,23 @@ \end{frame} \begin{frame} - \center{finding libril implementation} - - \raggedright - finding libril implementation: - \begin{verse} - vendor ril lib path either passed in as -l parameter, or read from rild.libpath property - \end{verse} - \begin{verse} - ril arguments either passed in as - - parameter, or read from rild.libargs property - \end{verse} + \center{finding libril implementation: hardware/ril/rild/rild.c} \end{frame} +\lstset{language=C} +\begin{lstlisting} + int main(int argc, char **argv) { + // vendor ril lib path either passed in as + // -l parameter, or read from rild.libpath + // property + const char *rilLibPath = NULL; + // ril arguments either passed in + // as -- parameter, or read from rild.libargs + // property + ... + } +\end{lstlisting} + \begin{frame} \center{finding libril implementation} \end{frame} @@ -230,21 +247,21 @@ \lstset{language=C} \begin{lstlisting} int main(int argc, char **argv) { - // [...] + ... const RIL_RadioFunctions *(*rilInit)( const struct RIL_Env *, int, char **); - // [...] + ... dlHandle = dlopen(rilLibPath, RTLD_NOW); - // [...] + ... RIL_startEventLoop(); - // [...] + ... rilInit = (const RIL_RadioFunctions *(*)( const struct RIL_Env *, int, char **)) dlsym(dlHandle, "RIL_Init"); funcs = rilInit(&s_rilEnv, argc, rilArgv); - // [...] + ... RIL_register(funcs); - // [...] + ... } \end{lstlisting} @@ -265,17 +282,17 @@ const RIL_RadioFunctions *RIL_Init( int argc, char **argv) { while ( -1 != (opt = getopt(argc, argv, "p:d:s:c:"))) { - // [...] + ... switch (opt) { - // [...] + ... case 'd': s_device_path = optarg; RLOGI("Opening tty device %s\n", s_device_path); break; - // [...] + ... } - } // [...] + } ... } \end{lstlisting} @@ -289,12 +306,12 @@ const RIL_RadioFunctions *RIL_Init( onCancel, getVersion }; - // [...] + ... const RIL_RadioFunctions *RIL_Init( const struct RIL_Env *env, int argc, char **argv) { - // [...] + ... return &s_callbacks; } \end{lstlisting} @@ -307,13 +324,13 @@ const RIL_RadioFunctions *RIL_Init( \begin{lstlisting} static void onRequest (int request, void *data, size_t datalen, RIL_Token t) { - // [...] + ... switch (request) { - // [...] + ... case RIL_REQUEST_DIAL: requestDial(data, datalen, t); break; - // case [...] + case ... } \end{lstlisting} @@ -325,11 +342,11 @@ const RIL_RadioFunctions *RIL_Init( \begin{lstlisting} static void requestDial(void *data, size_t datalen __unused, RIL_Token t) { - // [...] + ... ret = at_send_command(cmd, NULL); free(cmd); - // [...] + ... RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0); } @@ -346,7 +363,7 @@ const RIL_RadioFunctions *RIL_Init( \begin{lstlisting} static void onUnsolicited (const char *s, const char *sms_pdu) { - // [...] + ... if (strStartsWith(s,"+CRING:") || strStartsWith(s,"RING") || strStartsWith(s,"NO CARRIER") @@ -354,9 +371,9 @@ const RIL_RadioFunctions *RIL_Init( RIL_onUnsolicitedResponse ( RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED, NULL, 0); - // [...] + ... } - // [...] + ... } \end{lstlisting} @@ -368,10 +385,10 @@ const RIL_RadioFunctions *RIL_Init( const RIL_RadioFunctions *RIL_Init( const struct RIL_Env *env, int argc, char **argv) { - // [...] + ... ret = pthread_create(&s_tid_mainloop, &attr, mainLoop, NULL); - // [...] + ... } \end{lstlisting} @@ -381,9 +398,9 @@ const RIL_RadioFunctions *RIL_Init( \lstset{language=C} \begin{lstlisting} static void * mainLoop(void *param __unused) { - // [...] + ... ret = at_open(fd, onUnsolicited); - // [...] + ... } \end{lstlisting} @@ -393,16 +410,16 @@ const RIL_RadioFunctions *RIL_Init( \lstset{language=C} \begin{lstlisting} static ATUnsolHandler s_unsolHandler; - // [...] + ... int at_open(int fd, ATUnsolHandler h) { - // [...] + ... s_unsolHandler = h; - // [...] + ... ret = pthread_create(&s_tid_reader, &attr, readerLoop, &attr); - // [...] + ... } \end{lstlisting} @@ -416,11 +433,11 @@ const RIL_RadioFunctions *RIL_Init( static void *readerLoop(void *arg __unused) { for (;;) { - // [...] + ... processLine(line); - // [...] + ... } - // [...] + ... } \end{lstlisting} @@ -434,7 +451,7 @@ static void *readerLoop(void *arg __unused) if (sp_response == NULL) { /* no command pending */ handleUnsolicited(line); - } // [...] + } ... } \end{lstlisting} |