From 8cfa0ed821e386e1fb8e31f16522f7be67ba1d31 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 10 Oct 2007 09:16:31 +0000 Subject: Send error response in case of unsupported commands --- audio/headset.c | 12 +++++++----- 1 file 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) -- cgit