blob: e7cedd22ce7ded61a2ffe24fbc70d98e409ecfd9 [file] [log] [blame]
/*
* Copyright (C) 2006 The Android Open Source Project
*
* 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 AUDIO_IF_H
#define AUDIO_IF_H 1
#include <stdlib.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define AUDIO_IF_VERSION 1 /* Current version */
#define AUDIO_IF_UBUS_ID "audio_if"
/** AUDIO_IF_REQUEST_TEST : "data" is int "response" is int */
#define AUDIO_IF_REQUEST_TEST 1
/* TBD: these are for ubus client and need to be converted into different AUDIO_IF_REQUEST_* in second phase of audio solution */
#define AUDIO_IF__Volume_100_ID 32
#define AUDIO_IF__Volume_UP_ID 33
#define AUDIO_IF__Volume_DOWN_ID 34
#define AUDIO_IF__Volume_000_ID 35
#define AUDIO_IF__MUTE_ID 36
#define AUDIO_IF__UNMUTE_ID 37
#define AUDIO_IF__idle_ID 38
#define AUDIO_IF__ringtone_ID 39
#define AUDIO_IF__Voice_ID 40
#define AUDIO_IF__VOIP_ID 41
#define AUDIO_IF__Volume_100 "Volume_100"
#define AUDIO_IF__Volume_UP "Volume_UP"
#define AUDIO_IF__Volume_DOWN "Volume_DOWN"
#define AUDIO_IF__Volume_000 "Volume_000"
#define AUDIO_IF__Mute "Mute"
#define AUDIO_IF__UnMute "UnMute"
#define AUDIO_IF__idle "idle"
#define AUDIO_IF__ringtone "ringtone"
#define AUDIO_IF__Voice "Voice"
#define AUDIO_IF__VOIP "VOIP"
// end of TBD
#define AUDIO_IF_UNSOL_RESPONSE_BASE 1000
#define AUDIO_IF_MAX_CONTROL_TRANS_DEFAULT (64)
typedef void * user_data;
typedef enum {
AUDIO_IF_SUCCESS = 0,
AUDIO_IF_GEN_ERROR = 1,
} AUDIO_IF_Errno;
/***********************************************************************/
void AudioIf_ReadFromDevice(int fd);
void *AudioIf_MainLoopTask(void *arg) __attribute__((noreturn));
int AudioIf_BroadcastDTMFCode(unsigned short Code);
int AudioIf_BroadcastVoiceStatus(unsigned int status);
void AudioIf_report_voice_status(void);
#ifdef __cplusplus
}
#endif
#endif /*AUDIO_IF_H*/