From ee230fc4a8170dbb61dfa5564167ddcbb06b72ef Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Tue, 18 Jul 2017 15:31:17 +0200 Subject: [PATCH] avdtp util: add event to str function --- src/classic/avdtp_util.c | 21 +++++++++++++++++++++ src/classic/avdtp_util.h | 1 + 2 files changed, 22 insertions(+) diff --git a/src/classic/avdtp_util.c b/src/classic/avdtp_util.c index b623ab1dd..8bec7a8c8 100644 --- a/src/classic/avdtp_util.c +++ b/src/classic/avdtp_util.c @@ -49,6 +49,27 @@ #define MAX_MEDIA_CODEC_INFORMATION_LENGTH 100 +static const char * avdtp_si_name[] = { + "ERROR", + "AVDTP_SI_DISCOVER", + "AVDTP_SI_GET_CAPABILITIES", + "AVDTP_SI_SET_CONFIGURATION", + "AVDTP_SI_GET_CONFIGURATION", + "AVDTP_SI_RECONFIGURE", + "AVDTP_SI_OPEN", + "AVDTP_SI_START", + "AVDTP_SI_CLOSE", + "AVDTP_SI_SUSPEND", + "AVDTP_SI_ABORT", + "AVDTP_SI_SECURITY_CONTROL", + "AVDTP_SI_GET_ALL_CAPABILITIES", + "AVDTP_SI_DELAY_REPORT" +}; +const char * avdtp_si2str(uint16_t index){ + if (index <= 0 || index > sizeof(avdtp_si_name)) return avdtp_si_name[0]; + return avdtp_si_name[index]; +} + void avdtp_initialize_stream_endpoint(avdtp_stream_endpoint_t * stream_endpoint){ stream_endpoint->connection = NULL; stream_endpoint->state = AVDTP_STREAM_ENDPOINT_IDLE; diff --git a/src/classic/avdtp_util.h b/src/classic/avdtp_util.h index 4e9c79390..5dcf3984d 100644 --- a/src/classic/avdtp_util.h +++ b/src/classic/avdtp_util.h @@ -109,6 +109,7 @@ uint8_t avdtp_find_remote_sep(avdtp_connection_t * connection, uint8_t remote_se // uint16_t avdtp_cid(avdtp_stream_endpoint_t * stream_endpoint); uint8_t avdtp_local_seid(avdtp_stream_endpoint_t * stream_endpoint); uint8_t avdtp_remote_seid(avdtp_stream_endpoint_t * stream_endpoint); +const char * avdtp_si2str(uint16_t index); #if defined __cplusplus }