8

I'm working on the firmware of a device that is going to be connected to PCs using Bluetooth in serial port emulation mode.

During testing, I found out that modem-manager on Linux "helpfully" tries to detect it as a modem, sending the AT+GCAP command; to this, currently my device replies with something like INVALIDCMD AT+GCAP. That is the correct response for my protocol, but obviously isn't an AT reply, so modem-manager isn't satisfied and tries again with AT+GCAP and other modem-related stuff.

Now, I found some workarounds for modem-manager (see here and thus here, in particular the udev rule method), but:

  • they are not extremely robust (I have to make a custom udev rule that may break if we change the Bluetooth module);
  • I fear that not only modem-manager, but similar software/OS features (e.g. on Windows or OS X) may give me similar annoyances.

Also, having full control over the firmware, I can add a special case for AT+GCAP and similar stuff; so, coming to my question:

Is there a standard/safe reply to AT+GCAP and other similar modem-probing queries to tell "I'm not a modem, go away and leave me alone?"

Community
  • 1
  • 1
Matteo Italia
  • 123,740
  • 17
  • 206
  • 299
  • The proper response to a modem command if you are not a modem is *nothing*. It should give up after trying a couple of times. "ERROR" is a response to an AT command you don't implement. – Hans Passant Aug 13 '13 at 11:38
  • @HansPassant: so, if I just ignore everything that begins with `AT+` I should be safe? Are there other modem-probing messages I should be aware of? – Matteo Italia Aug 13 '13 at 11:48
  • You should ignore everything that starts with AT, some of them don't have a + – Hans Passant Aug 13 '13 at 11:50
  • @HansPassant: ugh, that's ugly... my protocol is text-based too, but fortunately I don't have commands that start with `AT`. Well, thank you for the advice, if you post it in an answer I'll be glad to upvote it (and accept it as soon as I'll be able to try it with the real hardware). – Matteo Italia Aug 13 '13 at 11:59
  • Surely there's a better way to wrangle Linux. I don't know it. – Hans Passant Aug 13 '13 at 12:01
  • 1
    @HansPassant: don't worry, I found a way to tell to modem-manager "leave alone this device", what I was looking for was just a "general" way for the device to tell "I appreciate your interest, but I'm not a modem", so to avoid platform-specific hacks. If you tell me that silence is the right answer, well, that's the answer I needed. :) – Matteo Italia Aug 13 '13 at 12:11
  • 1
    +1 for the effort you obviously have put in creating this answer, and yes silence would be the correct response. – hlovdal Sep 07 '13 at 08:57

1 Answers1

4

(making an answer out of the comments)

In order to indicate I do not understand any AT commands at all (aka I am not a modem) the correct response to any received AT commands should be silence.


In order to indicate I do not understand this particular AT command the correct response should be ERROR.

Anything between will trigger implementation defined behaviour of the entity sending AT commands. Some will possibly give up right away while modem-manager apparently is set on retrying sending the command until it gets a "proper" response.

hlovdal
  • 26,565
  • 10
  • 94
  • 165