avdtp util: add event to str function

This commit is contained in:
Milanka Ringwald 2017-07-18 15:31:17 +02:00
parent 21b232ce00
commit ee230fc4a8
2 changed files with 22 additions and 0 deletions

View File

@ -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;

View File

@ -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
}