| /* |
| * All Rights Reserved |
| * |
| * MARVELL CONFIDENTIAL |
| * Copyright 2012 Marvell International Ltd All Rights Reserved. |
| * The source code contained or described herein and all documents related to |
| * the source code ("Material") are owned by Marvell International Ltd or its |
| * suppliers or licensors. Title to the Material remains with Marvell International Ltd |
| * or its suppliers and licensors. The Material contains trade secrets and |
| * proprietary and confidential information of Marvell or its suppliers and |
| * licensors. The Material is protected by worldwide copyright and trade secret |
| * laws and treaty provisions. No part of the Material may be used, copied, |
| * reproduced, modified, published, uploaded, posted, transmitted, distributed, |
| * or disclosed in any way without Marvell's prior express written permission. |
| * |
| * No license under any patent, copyright, trade secret or other intellectual |
| * property right is granted to or conferred upon you by disclosure or delivery |
| * of the Materials, either expressly, by implication, inducement, estoppel or |
| * otherwise. Any license under such intellectual property rights must be |
| * express and approved by Marvell in writing. |
| * |
| */ |
| |
| #ifndef __H_APATHER__ |
| #define __H_APATHER__ |
| |
| #include <sys/types.h> |
| #include <sys/socket.h> |
| #include <netinet/in.h> |
| #include <arpa/inet.h> |
| #include <unistd.h> |
| #include <errno.h> |
| #include <strings.h> |
| #include <stdlib.h> |
| #include <stdio.h> |
| #include <string.h> |
| #include <getopt.h> |
| |
| #include <cutils/properties.h> |
| #include <system/audio.h> |
| #include "acm_api.h" |
| #include "acm_aph.h" |
| |
| #ifndef MAX_PATH |
| # define MAX_PATH 100 |
| #endif |
| |
| #define PATHS_NUM_MAX 20 //no less than APH_PATH_ID_CNT |
| #define COMMENT_MAX 256 |
| |
| typedef struct _command{ |
| char path[MAX_PATH]; |
| int volume; |
| int op; |
| int camera; |
| } PathCmd; |
| |
| typedef struct _command_ret{ |
| char comment[COMMENT_MAX]; |
| int ret; |
| } CommandRet; |
| |
| typedef struct _paths_list{ |
| char path[PATHS_NUM_MAX][MAX_PATH]; |
| int num; |
| } PathsList; |
| |
| const struct ret_error_string{ |
| int error; |
| char *info; |
| } RetErrorString[] = { |
| {ACM_RC_OK, "Success"}, |
| {ACM_RC_INVALID_PATH, "Invalid path"}, |
| {ACM_RC_PATH_CONFIG_NOT_EXIST, "Config not exist"}, |
| {ACM_RC_PATH_ALREADY_ENABLED, "Already enabled"}, |
| {ACM_RC_PATH_ALREADY_DISABLED, "Already disabled"}, |
| {ACM_RC_PATH_NOT_ENABLED, "Path not enabled"}, |
| {ACM_RC_NO_MUTE_CHANGE_NEEDED, "No mute change needed"}, |
| {ACM_RC_INVALID_VOLUME_CHANGE, "Invalid volume change"}, |
| {ACM_RC_INVALID_PARAMETER, "Invalid parameter"}, |
| {ACM_RC_FORCE_DELAY, "Force delay"}, |
| }; |
| |
| #define SERVER_PORT 6666 |
| #define SERVER_ADDR "0" |
| |
| #define OP_ENABLE 101 |
| #define OP_DISABLE 102 |
| #define OP_SETVOLUME 103 |
| #define OP_MUTE 104 |
| #define OP_LIST 105 |
| #define OP_STATUS 106 |
| |
| #define VOLUME_CAL(left, right) \ |
| (((left)+(right)) * 10 / 51) |
| |
| #define CODEC_MODE_OFFSET 0 |
| #define CODEC_RATE_OFFSET 1 |
| #define SIDETONE_OFFSET 2 |
| #define CODEC_VOIP_OFFSET 4 |
| #define CODEC_VT_OFFSET 4 |
| |
| #define MIC_MODE_MIC1 1 |
| #define MIC_MODE_MIC2 2 |
| #define MIC_MODE_BOTH 3 |
| |
| #endif |