/*===========================================================================
                    IMPORTANT NOTICE

                  OEM DISTRIBUTION ONLY

FILE:  bridle_phone.h

SERVICES:  BRIDLE OEMPhone System calls. 

GENERAL DESCRIPTION:
	Definitions, typedefs, etc. for bridle of AEEPhone.c

        Copyright © 2003 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
===========================================================================*/
#ifndef _BRIDLE_PHONE_H_
#define _BRIDLE_PHONE_H_

#include "AEEBridle.h"
#include "AEEkCB.h"

enum _tagBridlePhoneId{
   BRIDLE_PHONE_ID_OEMPhone_New,
   BRIDLE_PHONE_ID_OEMPhone_AddRef,
   BRIDLE_PHONE_ID_OEMPhone_Release,
   BRIDLE_PHONE_ID_OEMPhone_SetMask,
   BRIDLE_PHONE_ID_OEMPhone_AddListener,
   BRIDLE_PHONE_ID_OEMPhone_GetPhoneInfo,
   BRIDLE_PHONE_ID_OEMPhone_GetCallInfo,
   BRIDLE_PHONE_ID_OEMPhone_GetSystemInfo,
   BRIDLE_PHONE_ID_OEMPhone_GetPhoneInfo2,
   BRIDLE_PHONE_ID_OEMPhone_GetCallInfo2,
   BRIDLE_PHONE_ID_OEMPhone_GetSystemInfo2,
   BRIDLE_PHONE_ID_OEMPhone_GetMinWStr,
   BRIDLE_PHONE_ID_OEMPhone_GetMinStr,
   BRIDLE_PHONE_ID_OEMPhone_SetRSSIThreshold,
   BRIDLE_PHONE_ID_OEMPhone_MakeCall,
   BRIDLE_PHONE_ID_OEMPhone_AnswerCall,
   BRIDLE_PHONE_ID_OEMPhone_AnswerVoice,
   BRIDLE_PHONE_ID_OEMPhone_EndCall,
   BRIDLE_PHONE_ID_OEMPhone_Flash,
   BRIDLE_PHONE_ID_OEMPhone_SetPrefMode,
   BRIDLE_PHONE_ID_OEMPhone_SetNAM,
   BRIDLE_PHONE_ID_OEMPhone_SetOprtMode,
   BRIDLE_PHONE_ID_OEMPhone_BurstDTMF,
   BRIDLE_PHONE_ID_OEMPhone_StartDTMF,
   BRIDLE_PHONE_ID_OEMPhone_StopDTMF,
   BRIDLE_PHONE_ID_OEMPhone_IsVoiceCall,
   BRIDLE_PHONE_ID_OEMPhone_IsDataSupported,
   BRIDLE_PHONE_ID_OEMPhone_IsOffline,
   BRIDLE_PHONE_ID_OEMPhone_InConversation,
   BRIDLE_PHONE_ID_MAX
};

extern uint32 bridle_oemphone_swi;

#define Phone_BRIDLE1_RET( r, f, t1, v1, n1 ) BRIDLE1_RET( r, f, t1, v1, n1, bridle_oemphone_swi, BRIDLE_PHONE_ID_##f )
#define Phone_BRIDLE2_VOID( f, t1, v1, n1, t2, v2, n2 ) BRIDLE2_VOID( f, t1, v1, n1, t2, v2, n2, bridle_oemphone_swi, BRIDLE_PHONE_ID_##f )
#define Phone_BRIDLE2_RET( r, f, t1, v1, n1, t2, v2, n2 ) BRIDLE2_RET( r, f, t1, v1, n1, t2, v2, n2, bridle_oemphone_swi, BRIDLE_PHONE_ID_##f )
#define Phone_BRIDLE3_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3 ) BRIDLE3_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3, bridle_oemphone_swi, BRIDLE_PHONE_ID_##f )
#define Phone_BRIDLE4_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3, t4, v4, n4 ) BRIDLE4_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3, t4, v4, n4, bridle_oemphone_swi, BRIDLE_PHONE_ID_##f )
#define Phone_BRIDLE5_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3, t4, v4, n4, t5, v5, n5 ) BRIDLE5_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3, t4, v4, n4, t5, v5, n5, bridle_oemphone_swi, BRIDLE_PHONE_ID_##f )
#define Phone_BRIDLE10_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3, t4, v4, n4, t5, v5, n5, t6, v6, n6, t7, v7, n7, t8, v8, n8, t9, v9, n9, t10, v10, n10 ) BRIDLE10_RET( r, f, t1, v1, n1, t2, v2, n2, t3, v3, n3, t4, v4, n4, t5, v5, n5, t6, v6, n6, t7, v7, n7, t8, v8, n8, t9, v9, n9, t10, v10, n10, bridle_oemphone_swi, BRIDLE_PHONE_ID_##f )

Phone_BRIDLE1_RET( int, OEMPhone_New,
                   OEMPhone **, BRIDLE_CHECK_WRITEACCESS, sizeof(OEMPhone *) )

Phone_BRIDLE1_RET( int, OEMPhone_AddRef,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( int, OEMPhone_Release,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_VOID( OEMPhone_SetMask,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   uint32, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( int, OEMPhone_AddListener,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   AEECallback *, BRIDLE_CHECK_AEEKCB, 4 )

Phone_BRIDLE1_RET( const cm_ph_info_s_type *, OEMPhone_GetPhoneInfo,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( const CM_CALL_INFO_S_TYPE *, OEMPhone_GetCallInfo,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( const CM_SS_INFO_S_TYPE *, OEMPhone_GetSystemInfo,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( boolean, OEMPhone_GetPhoneInfo2,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   cm_ph_info_s_type *, BRIDLE_CHECK_WRITEACCESS, sizeof(cm_ph_info_s_type) )

Phone_BRIDLE2_RET( boolean, OEMPhone_GetCallInfo2,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   CM_CALL_INFO_S_TYPE *, BRIDLE_CHECK_WRITEACCESS, sizeof(CM_CALL_INFO_S_TYPE) )

Phone_BRIDLE2_RET( boolean, OEMPhone_GetSystemInfo2,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   CM_SS_INFO_S_TYPE *, BRIDLE_CHECK_WRITEACCESS, sizeof(CM_SS_INFO_S_TYPE) )

Phone_BRIDLE4_RET( int, OEMPhone_GetMinWStr,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   int, BRIDLE_CHECK_NONE, 0,
                   AECHAR *, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_4,
                   int, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE4_RET( int, OEMPhone_GetMinStr,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   int, BRIDLE_CHECK_NONE, 0,
                   char *, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_4,
                   int, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( int, OEMPhone_SetRSSIThreshold,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   uint8, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE10_RET( int, OEMPhone_MakeCall, OEMPhone *, BRIDLE_CHECK_NONE, 0, cm_call_type_e_type, BRIDLE_CHECK_NONE, 0,
                   cm_srv_type_e_type, BRIDLE_CHECK_NONE, 0, word, BRIDLE_CHECK_NONE, 0, const byte *, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_6,
                   byte, BRIDLE_CHECK_NONE, 0, cm_digit_mode_e_type, BRIDLE_CHECK_NONE, 0, const byte *, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_9,
                   byte, BRIDLE_CHECK_NONE, 0, CM_ACTIVATE_CODE_TYPE, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( int, OEMPhone_AnswerCall,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   cm_call_type_e_type, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE3_RET( int, OEMPhone_AnswerVoice,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   cm_answer_voice_e_type, BRIDLE_CHECK_NONE, 0,
                   dword, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( int, OEMPhone_EndCall,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE3_RET( int, OEMPhone_Flash,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   const byte*, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_3,
                   byte, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE4_RET( int, OEMPhone_SetPrefMode,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   cm_mode_pref_e_type, BRIDLE_CHECK_NONE, 0,
                   CM_MODE_TERM_E_TYPE, BRIDLE_CHECK_NONE, 0,
                   uint32, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( int, OEMPhone_SetNAM,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   cm_nam_e_type, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( int, OEMPhone_SetOprtMode,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   CM_OPRT_MODE_E_TYPE, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE5_RET( int, OEMPhone_BurstDTMF,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   uint8, BRIDLE_CHECK_NONE, 0,
                   uint8, BRIDLE_CHECK_NONE, 0,
                   const uint8 *, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_5,
                   uint8, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( int, OEMPhone_StartDTMF,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   uint8, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE2_RET( int, OEMPhone_StopDTMF,
                   OEMPhone *, BRIDLE_CHECK_NONE, 0,
                   uint16, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( boolean, OEMPhone_IsVoiceCall,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( boolean, OEMPhone_IsDataSupported,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( boolean, OEMPhone_IsOffline,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )

Phone_BRIDLE1_RET( boolean, OEMPhone_InConversation,
                  OEMPhone *, BRIDLE_CHECK_NONE, 0 )


/* Define this macro to invoke the OEMPhone_* services
** bypassing the bridle transport */
#ifndef PHONE_SVC

#define OEMPhone_New                packbridle_OEMPhone_New
#define OEMPhone_AddRef             packbridle_OEMPhone_AddRef
#define OEMPhone_Release            packbridle_OEMPhone_Release
#define OEMPhone_SetMask            packbridle_OEMPhone_SetMask
#define OEMPhone_AddListener        packbridle_OEMPhone_AddListener
#define OEMPhone_GetPhoneInfo       packbridle_OEMPhone_GetPhoneInfo
#define OEMPhone_GetCallInfo        packbridle_OEMPhone_GetCallInfo
#define OEMPhone_GetSystemInfo      packbridle_OEMPhone_GetSystemInfo
#define OEMPhone_GetPhoneInfo2      packbridle_OEMPhone_GetPhoneInfo2
#define OEMPhone_GetCallInfo2       packbridle_OEMPhone_GetCallInfo2
#define OEMPhone_GetSystemInfo2     packbridle_OEMPhone_GetSystemInfo2
#define OEMPhone_GetMinWStr         packbridle_OEMPhone_GetMinWStr
#define OEMPhone_GetMinStr          packbridle_OEMPhone_GetMinStr
#define OEMPhone_SetRSSIThreshold   packbridle_OEMPhone_SetRSSIThreshold
#define OEMPhone_MakeCall           packbridle_OEMPhone_MakeCall
#define OEMPhone_AnswerCall         packbridle_OEMPhone_AnswerCall
#define OEMPhone_AnswerVoice        packbridle_OEMPhone_AnswerVoice
#define OEMPhone_EndCall            packbridle_OEMPhone_EndCall
#define OEMPhone_Flash              packbridle_OEMPhone_Flash
#define OEMPhone_SetPrefMode        packbridle_OEMPhone_SetPrefMode
#define OEMPhone_SetNAM             packbridle_OEMPhone_SetNAM
#define OEMPhone_SetOprtMode        packbridle_OEMPhone_SetOprtMode
#define OEMPhone_BurstDTMF          packbridle_OEMPhone_BurstDTMF
#define OEMPhone_StartDTMF          packbridle_OEMPhone_StartDTMF
#define OEMPhone_StopDTMF           packbridle_OEMPhone_StopDTMF
#define OEMPhone_IsVoiceCall        packbridle_OEMPhone_IsVoiceCall
#define OEMPhone_IsDataSupported    packbridle_OEMPhone_IsDataSupported
#define OEMPhone_IsOffline          packbridle_OEMPhone_IsOffline
#define OEMPhone_InConversation     packbridle_OEMPhone_InConversation

#endif  /* PHONE_SVC */

#endif // _BRIDLE_PHONE_H_
