Classes | Macros | Typedefs | Enumerations | Functions
ams_c.h File Reference

Apple Media Service Client API. More...

`#include "gr_includes.h"`
`#include "ble_prf_types.h"`
`#include "custom_config.h"`

Go to the source code of this file.

## Classes
struct | ams_c_ett_attr_id_t
| Structure that stores the attribute to be concerned or to display completely. More...
struct | ams_c_cmd_list_t
| Structure that stores new command list. More...
struct | ams_c_attr_info_t
| Structure that stores attribute information. More...
struct | ams_c_cplt_attr_data_t
| Complete attribution's value . More...
struct | ams_c_handles_t
| Handles on the connected peer device needed to interact with it. More...
struct | ams_c_evt_t
| Apple Media Service Client event. More...

## Macros
#define | AMS_C_CONNECTION_MAX 10
#define | AMS_C_ATTR_COUNT_MAX 256
#define | AMS_C_TRUNCATED_FLAG (0x01<<0)
#define | AMS_SRVC_UUID
#define | AMS_CMD_UUID
#define | AMS_ATTR_UPDATE_UUID
#define | AMS_ATTR_DISPLAY_UUID

## Typedefs
typedef void(* | ams_c_evt_handler_t) (ams_c_evt_t *p_evt)
| Apple Media Service Client event handler type. More...

## Enumerations
enum | ams_c_cmd_id_t { AMS_CMD_ID_PLAY, AMS_CMD_ID_PAUSE, AMS_CMD_ID_TOGGLE_PLAY_PAUSE, AMS_CMD_ID_NEXT_TRACK, AMS_CMD_ID_PREVIOUS_TRACK, AMS_CMD_ID_VOLUME_UP, AMS_CMD_ID_VOLUME_DOWN, AMS_CMD_ID_ADVANCE_REPEAT_MODE, AMS_CMD_ID_ADVANCE_SHUFFLE_MODE, AMS_CMD_ID_SKIP_FORWARD, AMS_CMD_ID_SKIP_BACKWARD, AMS_CMD_ID_LIKE_TRACK, AMS_CMD_ID_DISLIKE_TRACK, AMS_CMD_ID_BOOK_MARK_TRACK }
| Apple Media Service Command ID. More...
enum | ams_c_ett_id_t { AMS_ETT_ID_PLAYER, AMS_ETT_ID_QUEUE, AMS_ETT_ID_TRACK }
| Apple Media Service entities index. More...
enum | { BLE_GATT_COMMON_EVT_MTU_EXCHANGE = BLE_GATT_COMMON_EVT_BASE, BLE_GATT_COMMON_EVT_PRF_REGISTER, BLE_GATT_COMMON_EVT_MAX, ISO_GPIO_MASK_0 = 0x1, ISO_GPIO_MASK_1 = 0x2, ISO_GPIO_MASK_2 = 0x4, ISO_GPIO_MASK_3 = 0x8, ISO_GPIO_MASK_4 = 0x10, ISO_GPIO_MASK_5 = 0x20, ISO_GPIO_MASK_6 = 0x40, ISO_GPIO_MASK_7 = 0x80, AMS_PLAYER_ATTR_ID_NAME, AMS_PLAYER_ATTR_ID_PLAYBACK_INFO, AMS_PLAYER_ATTR_ID_VOLUME, IAS_ALERT_NONE, IAS_ALERT_MILD, IAS_ALERT_HIGH, EXFLASH_CONFIG_CACHE_MODE = 0x00, EXFLASH_CONFIG_READ_CMD = 0x01, EXFLASH_CONFIG_BAUD_RATE = 0x02, EXFLASH_CONFIG_CLOCK_MODE = 0x03, EXFLASH_CONFIG_CACHE_FLUSH = 0x04, EXFLASH_CONFIG_PAGE_TYPE = 0x05, DFU_CACHE_TYPE_CALL_STACK = 0x00, DFU_CACHE_TYPE_REG, TRC_PWR_WFE_MODE = 0, TRC_PWR_DSLEEP_MODE, TRC_PWR_ACTIVE_MODE, TRC_PWR_BLE_RET_DSLEEP, TRC_PWR_APP_TIMER_REFUSE, TRC_PWR_APP_TIMER_PASS, TRC_PWR_BLE_TIMER_REFUSE, TRC_PWR_BLE_TIMER_PASS, TRC_PWR_RTC_TIMER_REFUSE, TRC_PWR_RTC_TIMER_PASS, TRC_PWR_RTC1_TIMER_REFUSE, TRC_PWR_RTC1_TIMER_PASS, TRC_PWR_WDT_TIMER_REFUSE, TRC_PWR_WDT_TIMER_PASS }
| Apple Media Service player attribute index. More...
enum | { AMS_QUEUE_ATTR_ID_INDEX, AMS_QUEUE_ATTR_ID_COUNT, AMS_QUEUE_ATTR_ID_SHUFFLE_MODE, AMS_QUEUE_ATTR_ID_REPEAT_MODE }
| Apple Media Service queue attribute index. More...
enum | { AMS_TRACK_ATTR_ID_ARTIST, AMS_TRACK_ATTR_ID_ALBUM, AMS_TRACK_ATTR_ID_TITTLE, AMS_TRACK_ATTR_ID_DURATION }
| Apple Media Service track attribute index. More...
enum | ams_c_evt_type_t { AMS_C_EVT_INVALID, AMS_C_EVT_DISCOVERY_CPLT, AMS_C_EVT_DISCOVERY_FAIL, AMS_C_EVT_CMD_SEND_SUCCESS, AMS_C_EVT_CMD_UPDATE_RECEIVE, AMS_C_EVT_CMD_UPDATE_NTF_SET_SUCCESS, AMS_C_EVT_ATTR_FOCUS_SET_SUCCESS, AMS_C_EVT_ATTR_UPDATE_RECEIVE, AMS_C_EVT_ATTR_UPDATE_NTF_SET_SUCCESS, AMS_C_EVT_CPLT_ATTR_DISPLAY_SET_SUCCESS, AMS_C_EVT_CPLT_ATTR_READ_RSP, AMS_C_EVT_WRITE_OP_ERR }
| Apple Media Service Client Event type. More...

## Functions
sdk_err_t | ams_c_client_init (ams_c_evt_handler_t evt_handler)
| Register AMS Client event handler. More...
sdk_err_t | ams_c_disc_srvc_start (uint8_t conn_idx)
| Discover Apple Media Service on peer. More...
sdk_err_t | ams_c_cmd_notify_set (uint8_t conn_idx, bool is_enable)
| Enable or disable peer new command list notify. More...
sdk_err_t | ams_c_attr_update_notify_set (uint8_t conn_idx, bool is_enable)
| Enable or disable peer updated attribute notify. More...
sdk_err_t | ams_c_cplt_attr_read (uint8_t conn_idx)
| Read complete value of updated attrbute . More...
sdk_err_t | ams_c_cmd_send (uint8_t conn_idx, uint8_t cmd_id)
| Send command to peer device. More...
sdk_err_t | ams_c_attr_focus_set (uint8_t conn_idx, const ams_c_ett_attr_id_t *p_ett_attr_id)
| Set concerned attribute. More...
sdk_err_t | ams_c_attr_display_set (uint8_t conn_idx, const ams_c_attr_info_t *p_attr_info)
| Set the attribute that needs to be completely displayed. More...
bool | ams_c_cmd_enable_check (ams_c_cmd_id_t cmd_id)
| Check if the command is available. More...

## Detailed Description

Apple Media Service Client API.

Attention
  #####Copyright (c) 2019 GOODIX All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file ams_c.h.