// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef __ESP_AVRC_API_H__ #define __ESP_AVRC_API_H__ #include #include #include "esp_err.h" #include "esp_bt_defs.h" #ifdef __cplusplus extern "C" { #endif /// AVRC feature bit mask typedef enum { ESP_AVRC_FEAT_RCTG = 0x0001, /*!< remote control target */ ESP_AVRC_FEAT_RCCT = 0x0002, /*!< remote control controller */ ESP_AVRC_FEAT_VENDOR = 0x0008, /*!< remote control vendor dependent commands */ ESP_AVRC_FEAT_BROWSE = 0x0010, /*!< use browsing channel */ ESP_AVRC_FEAT_META_DATA = 0x0040, /*!< remote control metadata transfer command/response */ ESP_AVRC_FEAT_ADV_CTRL = 0x0200, /*!< remote control advanced control commmand/response */ } esp_avrc_features_t; /// AVRC passthrough command code typedef enum { ESP_AVRC_PT_CMD_PLAY = 0x44, /*!< play */ ESP_AVRC_PT_CMD_STOP = 0x45, /*!< stop */ ESP_AVRC_PT_CMD_PAUSE = 0x46, /*!< pause */ ESP_AVRC_PT_CMD_FORWARD = 0x4B, /*!< forward */ ESP_AVRC_PT_CMD_BACKWARD = 0x4C, /*!< backward */ ESP_AVRC_PT_CMD_REWIND = 0x48, /*!< rewind */ ESP_AVRC_PT_CMD_FAST_FORWARD = 0x49 /*!< fast forward */ } esp_avrc_pt_cmd_t; /// AVRC passthrough command state typedef enum { ESP_AVRC_PT_CMD_STATE_PRESSED = 0, /*!< key pressed */ ESP_AVRC_PT_CMD_STATE_RELEASED = 1 /*!< key released */ } esp_avrc_pt_cmd_state_t; /// AVRC Controller callback events typedef enum { ESP_AVRC_CT_CONNECTION_STATE_EVT = 0, /*!< connection state changed event */ ESP_AVRC_CT_PASSTHROUGH_RSP_EVT = 1, /*!< passthrough response event */ ESP_AVRC_CT_METADATA_RSP_EVT = 2, /*!< metadata response event */ ESP_AVRC_CT_PLAY_STATUS_RSP_EVT = 3, /*!< play status response event */ ESP_AVRC_CT_CHANGE_NOTIFY_EVT = 4, /*!< notification event */ ESP_AVRC_CT_REMOTE_FEATURES_EVT = 5, /*!< feature of remote device indication event */ } esp_avrc_ct_cb_event_t; /// AVRC metadata attribute mask typedef enum { ESP_AVRC_MD_ATTR_TITLE = 0x1, /*!< title of the playing track */ ESP_AVRC_MD_ATTR_ARTIST = 0x2, /*!< track artist */ ESP_AVRC_MD_ATTR_ALBUM = 0x4, /*!< album name */ ESP_AVRC_MD_ATTR_TRACK_NUM = 0x8, /*!< track position on the album */ ESP_AVRC_MD_ATTR_NUM_TRACKS = 0x10, /*!< number of tracks on the album */ ESP_AVRC_MD_ATTR_GENRE = 0x20, /*!< track genre */ ESP_AVRC_MD_ATTR_PLAYING_TIME = 0x40 /*!< total album playing time in miliseconds */ } esp_avrc_md_attr_mask_t; /// AVRC event notification ids typedef enum { ESP_AVRC_RN_PLAY_STATUS_CHANGE = 0x01, /*!< track status change, eg. from playing to paused */ ESP_AVRC_RN_TRACK_CHANGE = 0x02, /*!< new track is loaded */ ESP_AVRC_RN_TRACK_REACHED_END = 0x03, /*!< current track reached end */ ESP_AVRC_RN_TRACK_REACHED_START = 0x04, /*!< current track reached start position */ ESP_AVRC_RN_PLAY_POS_CHANGED = 0x05, /*!< track playing position changed */ ESP_AVRC_RN_BATTERY_STATUS_CHANGE = 0x06, /*!< battery status changed */ ESP_AVRC_RN_SYSTEM_STATUS_CHANGE = 0x07, /*!< system status changed */ ESP_AVRC_RN_APP_SETTING_CHANGE = 0x08, /*!< application settings changed */ ESP_AVRC_RN_MAX_EVT } esp_avrc_rn_event_ids_t; /// AVRC player setting ids typedef enum { ESP_AVRC_PS_EQUALIZER = 0x01, /*!< equalizer, on or off */ ESP_AVRC_PS_REPEAT_MODE = 0x02, /*!< repeat mode */ ESP_AVRC_PS_SHUFFLE_MODE = 0x03, /*!< shuffle mode */ ESP_AVRC_PS_SCAN_MODE = 0x04, /*!< scan mode on or off */ ESP_AVRC_PS_MAX_ATTR } esp_avrc_ps_attr_ids_t; /// AVRC equalizer modes typedef enum { ESP_AVRC_PS_EQUALIZER_OFF = 0x1, /*!< equalizer OFF */ ESP_AVRC_PS_EQUALIZER_ON = 0x2 /*!< equalizer ON */ } esp_avrc_ps_eq_value_ids_t; /// AVRC repeat modes typedef enum { ESP_AVRC_PS_REPEAT_OFF = 0x1, /*!< repeat mode off */ ESP_AVRC_PS_REPEAT_SINGLE = 0x2, /*!< single track repeat */ ESP_AVRC_PS_REPEAT_GROUP = 0x3 /*!< group repeat */ } esp_avrc_ps_rpt_value_ids_t; /// AVRC shuffle modes typedef enum { ESP_AVRC_PS_SHUFFLE_OFF = 0x1, /*