diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-01-23 12:10:45 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-01-23 12:10:45 +0000 |
commit | b8e9425de9f30f87f7315fe9b5ca76348de16f44 (patch) | |
tree | e2af0ec0c4171546373b55e7c97a6d97978c361f | |
parent | 4d856c90b8f7f942f04b71bae68b0f864ea181eb (diff) |
Reply with ERROR to unknown headset commands
-rw-r--r-- | audio/headset.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c index d2dc7416..fbc66371 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -441,7 +441,10 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond, *cr = '\0'; err = handle_event(device, &hs->buf[hs->data_start]); - if (err < 0) + if (err = -EINVAL) { + error("Received unknown command: %s", &hs->buf[hs->data_start]); + err = headset_send(hs, "\r\nERROR\r\n"); + } else if (err < 0) error("Error handling command %s: %s (%d)", &hs->buf[hs->data_start], strerror(-err), -err); |