summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-10 09:16:31 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-10-10 09:16:31 +0000
commit8cfa0ed821e386e1fb8e31f16522f7be67ba1d31 (patch)
treefcfe25c342e64a443e1641cd2472f094b29fad30 /audio
parent86898be87d24991e48d783b3e20696ff1ce62abc (diff)
Send error response in case of unsupported commands
Diffstat (limited to 'audio')
-rw-r--r--audio/headset.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 700149ee..9abc824d 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -177,14 +177,16 @@ static headset_event_t parse_headset_event(const char *buf, char *rsp,
buf += 2;
- snprintf(rsp, rsp_len, "\r\nOK\r\n");
-
- if (!strncmp(buf, "+CKPD", 5))
+ if (!strncmp(buf, "+CKPD", 5)) {
+ snprintf(rsp, rsp_len, "\r\nOK\r\n");
return HEADSET_EVENT_KEYPRESS;
- else if (!strncmp(buf, "+VG", 3))
+ } else if (!strncmp(buf, "+VG", 3)) {
+ snprintf(rsp, rsp_len, "\r\nOK\r\n");
return HEADSET_EVENT_GAIN;
- else
+ } else {
+ snprintf(rsp, rsp_len, "\r\nERROR\r\n");
return HEADSET_EVENT_UNKNOWN;
+ }
}
static void close_sco(struct device *device)