kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: How to log USB modem data for a specific device?
Date: Tue, 12 Nov 2019 13:15:52 -0500	[thread overview]
Message-ID: <CAH8yC8=+Gu-4kch7WEu_VZ6JVbjP_yScxpwV8Lk-XpbiFc2yBA@mail.gmail.com> (raw)
In-Reply-To: <CAH8yC8m444vH8eyXrNVpqzvKhnOvAckKr5AKNjL4eUt=oVOUcw@mail.gmail.com>

On Tue, Nov 12, 2019 at 1:20 AM Jeffrey Walton <noloader@gmail.com> wrote:
>
> On Tue, Nov 12, 2019 at 12:37 AM Greg KH <greg@kroah.com> wrote:
> > ...
> >
> > > Here's why I want to specify a device number:
> > >
> > >     $ cat /sys/kernel/debug/usb/devices | grep -i -c 'Bus=01'
> > >     13
> > >
> > > It is too much information for me to sift through. I'll do it if I
> > > have to, but I prefer the tools do the work for me (rather than me do
> > > the work of the tools).
> >
> > That explains why you only want one device's data, but does not answer
> > why you want that data at all :)
>
> I have a pet project like NoMoRobo. It is essentially a call blocking
> service that depends on Caller ID. My pet project takes things a step
> further by initiating a call trace on suspicious numbers, and also
> files FCC and FTC complaints.
>
> The program works well with Conexant, Accura/Hayes and MultiTech
> modems. The program chokes on USR modems. For USR I get the RING
> message, but not the Caller ID information. From my program's
> perspective, it looks like the Caller ID information is never sent.
>
> So I want to perform some low level traces to understand why I am
> mishandling things.
>
> The GNU screen program receives the information as expected. The
> problem is, GNU screen does not show me individual messages. I don't
> know where one message ends and another begins. (One of my theories is
> the USR modem is batching RING and Caller ID into a single message).

I think I tracked down the problem.

The Caller ID information was not sent from the USR modem to my
program. It seems reading the ring count from the S1 register after a
RING is destructive for USR modems. My program fetches the ring count
for each RING message.

GNU's screen did not witness the problem because screen did not fetch
ring count when it encountered a RING message.

Getting the ring count is as simple as 'write(fd, "ATS1?\r", 6);' and
then parsing the result of 'read(fd, buff, size);'. The ASCII result
will be 001, 002, 003, etc. There's not much to it.

Fetching the ring count from the modem was a simple way to track
state. I guess I have to rethink the way I track state and perform
state transitions.

Jeff

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

      reply	other threads:[~2019-11-12 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 16:11 How to log USB modem data for a specific device? Jeffrey Walton
2019-11-11 16:31 ` Greg KH
2019-11-11 16:40   ` Jeffrey Walton
2019-11-11 17:24     ` Greg KH
2019-11-11 22:57       ` Jeffrey Walton
2019-11-12  5:37         ` Greg KH
2019-11-12  6:20           ` Jeffrey Walton
2019-11-12 18:15             ` Jeffrey Walton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH8yC8=+Gu-4kch7WEu_VZ6JVbjP_yScxpwV8Lk-XpbiFc2yBA@mail.gmail.com' \
    --to=noloader@gmail.com \
    --cc=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).