#ifndef AEETSUPPSTYPES_H
#define AEETSUPPSTYPES_H
/*======================================================
FILE:  AEETSuppsTypes.h

SERVICES:  Definitions of data structures used for Supplementary services.

GENERAL DESCRIPTION:

        Copyright © 2004 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
=====================================================*/


/* identifies a supplementary service transaction by ID. */
typedef uint32 AEETSuppsTransId;

/* A reserved ID used to create a mobile initiated transaction */
#define AEET_SUPPSVC_TRANSID_NEW   0xFFFFFFFF

/* New event mask to IPhoneNotifier. Notified when network initiates a new transaction. */
#define AEET_NMASK_NEW_NI_SUPP_TRANS  0x0200

/* The maximum size of string request acceptable by standard */
#define AEETSUPPS_MAX_DATA_LEN 160

#define AEETSUPPS_FWD_FEATURE_LIST_SIZE       13 /*Max Number of Fwd To Numbers*/
#define AEETSUPPS_CALL_BARRING_LIST_SIZE      13 /*Max Number of Call Barred Numbers*/
#define AEETSUPPS_BASIC_SERV_GROUP_LIST_SIZE  13 /*Max Number of Basic Srv Groups*/

#define AEETSUPPS_MAX_PASSWD_LEN                 8  /* Maximum number of characters acceptable for password */
#define AEETSUPPS_MAX_IMEI_LEN                16 /* 15 bytes of IMEI followed by NULL termination */

#define AEETSUPPS_ERR_BM(val) ((val) << 16)


/* ERROR tags */
#define AEETSUPPS_ERROR_CODE_TAG          0x02
#define AEETSUPPS_MN_SS_ERROR_TAG         0xc0  /* used by MN -> network */
#define AEETSUPPS_GENERAL_PROBLEM         0x80
#define AEETSUPPS_INVOKE_PROBLEM          0x81
#define AEETSUPPS_RETURN_RESULT_PROBLEM   0x82
#define AEETSUPPS_RETURN_ERROR_PROBLEM    0x83

/* SS error codes */
typedef enum
{
   AEETSUPPS_ERR_NO_ERR            = 0x00 | (AEETSUPPS_ERR_BM(0x00)),
   /*Unknown Subscriber Error*/
   AEETSUPPS_ERR_UNKNOWN_SUBR=0x01 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Illegal Subscriber*/
   AEETSUPPS_ERR_ILLEGAL_SUBS=0x09 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Bearer Service Not Provisioned*/
   AEETSUPPS_ERR_BR_SRV_NOT_PRV  =0x0A | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Tele Service Not Provisioned*/
   AEETSUPPS_ERR_TELE_SRV_NOT_PRV=0x0B | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Illegal Equipment*/
   AEETSUPPS_ERR_ILLEGAL_EQUIP   =0x0C | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Call Barred Error*/
   AEETSUPPS_ERR_CALL_BARRED     =0x0D | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*ILllegal SS Operation*/
   AEETSUPPS_ERR_ILLEGAL_SS_OP=0x10 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*SS Error Status*/
   AEETSUPPS_ERR_SS_ERR_STATUS   =0x11 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Supplemtary Service Not Available*/
   AEETSUPPS_ERR_SS_NOT_AVAIL    =0x12 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Supplementaruy Service Subscription Violation*/
   AEETSUPPS_ERR_SS_SUBR_VIOLATION =0x13 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Supplementary Service Not compatible*/
   AEETSUPPS_ERR_SS_INCOMPATIBLE =0x14 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Facility Not Supported */
   AEETSUPPS_ERR_FACILITY_NOT_SUPP =0x15 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Subscription Absent*/
   AEETSUPPS_ERR_ABSENT_SUBR       =0x1B | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Short Term Denial*/
   AEETSUPPS_ERR_SHORT_TERM_DENIAL=0x1D | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Long Term Denial*/
   AEETSUPPS_ERR_LONG_TERM_DENIAL  =0x1E | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*System Failure*/
   AEETSUPPS_ERR_SYSTEM_FAILURE=0x22 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Missing Information*/
   AEETSUPPS_ERR_DATA_MISSING      =0x23 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Unexpected data value*/
   AEETSUPPS_ERR_UNEXPT_DATA_VALUE =0x24 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Password Registration Failure*/
   AEETSUPPS_ERR_PASSWD_REG_FAILURE   =0x25 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Neagtive Password Check*/
   AEETSUPPS_ERR_NEGATIVE_PASSWD_CHECK=0x26 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Maximum number of password attempts reached*/
   AEETSUPPS_ERR_MAX_PASSWD_ATTEMPTS=0x2C | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Position MEthod Failure*/
   AEETSUPPS_ERR_POS_METHOD_FAILURE=0x36 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Unknown Alphabet*/
   AEETSUPPS_ERR_UNKNOWN_ALPHABET=0x47 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Sent USSD while User was busy*/
   AEETSUPPS_ERR_USSD_BUSY         =0x48 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Rejected By User*/
   AEETSUPPS_ERR_REJ_BY_USER=0x79 | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Rejected By Network*/
   AEETSUPPS_ERR_REJ_BY_NETWORK    =0x7A | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Deflected to Service Scubriber*/
   AEETSUPPS_ERR_DEF_TO_SRV_SUBR   =0x7B | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Special Service Code*/
   AEETSUPPS_ERR_SPECIAL_SRV_CODE  =0x7C | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Invalid Deflected To Number */
   AEETSUPPS_ERR_INVALID_DEF_TO_NUM=0x7D | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),
   /*Maximum Multiparty Calls Exceeded*/
   AEETSUPPS_ERR_MAX_MPTY_EXCEEDED =0x7E | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)), 
   /*Resources Not Avilable*/
   AEETSUPPS_ERR_RES_NOT_AVAILABLE =0x7F | (AEETSUPPS_ERR_BM(AEETSUPPS_ERROR_CODE_TAG)),

   /* MN specific values for ss errors     */
   AEETSUPPS_ERR_MN_INSUFFICIENT_RESOURCES    =0x01 |AEETSUPPS_ERR_BM(AEETSUPPS_MN_SS_ERROR_TAG ), 
   /*Split Multiparty Rejected*/
   AEETSUPPS_ERR_MN_SPLIT_MPTY_REJ            =0x02 |AEETSUPPS_ERR_BM(AEETSUPPS_MN_SS_ERROR_TAG ), 
   AEETSUPPS_ERR_MN_CALL_HOLD_REJ             =0x03 |AEETSUPPS_ERR_BM(AEETSUPPS_MN_SS_ERROR_TAG ), 
   AEETSUPPS_ERR_MN_CALL_RETRIEVE_REJ         =0x04 |AEETSUPPS_ERR_BM(AEETSUPPS_MN_SS_ERROR_TAG ), 
   AEETSUPPS_ERR_MN_NETWORK_NOT_RESPONDING    =0x05 |AEETSUPPS_ERR_BM(AEETSUPPS_MN_SS_ERROR_TAG ), 

   /* General problem codes */
   AEETSUPPS_ERR_UNRECOGNISED_COMPONENT     = 0x00 |AEETSUPPS_ERR_BM(AEETSUPPS_GENERAL_PROBLEM),  
   AEETSUPPS_ERR_MISTYPED_COMPONENT         = 0x01 |AEETSUPPS_ERR_BM(AEETSUPPS_GENERAL_PROBLEM),       
   AEETSUPPS_ERR_BADLY_STRUCTURED_COMPONENT = 0x02 |AEETSUPPS_ERR_BM(AEETSUPPS_GENERAL_PROBLEM),

   /* Invoke problem codes */
   AEETSUPPS_ERR_DUPLICATE_INVOKE_ID         =0x00 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),
   AEETSUPPS_ERR_UNRECOGNISED_OPERATION      =0x01 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),
   AEETSUPPS_ERR_MISTYPED_PARAMETER          =0x02 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),
   AEETSUPPS_ERR_RESOURCE_LIMITATION         =0x03 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),
   AEETSUPPS_ERR_INITIATING_RELEASE          =0x04 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),
   AEETSUPPS_ERR_UNRECOGNISED_LINKED_ID      =0x05 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),
   AEETSUPPS_ERR_LINKED_RESPONSE_UNEXPECTED  =0x06 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),
   AEETSUPPS_ERR_UNEXPECTED_LINKED_OPERATION =0x07 | AEETSUPPS_ERR_BM(AEETSUPPS_INVOKE_PROBLEM ),

   /* Return Result codes */
   AEETSUPPS_ERR_UNRECOGNISED_INVOKE_ID          =0x00 | AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_RESULT_PROBLEM ),
   AEETSUPPS_ERR_RETURN_RESULT_UNEXPECTED        =0x01 | AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_RESULT_PROBLEM ),
   AEETSUPPS_ERR_RETURN_RESULT_MISTYPED_PARAMETER=0x02 | AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_RESULT_PROBLEM ),

   /* Return Error codes */
   AEETSUPPS_ERR_RETURN_ERROR_UNRECOGNISED_INVOKE_ID =0x00 |AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_ERROR_PROBLEM ), 
   AEETSUPPS_ERR_RETURN_ERROR_UNEXPECTED             =0x01 |AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_ERROR_PROBLEM ), 
   AEETSUPPS_ERR_UNRECOGNISED_ERROR                  =0x02 |AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_ERROR_PROBLEM ), 
   AEETSUPPS_ERR_UNEXPECTED_ERROR                    =0x03 |AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_ERROR_PROBLEM ), 
   AEETSUPPS_ERR_RETURN_ERROR_MISTYPED_PARAMETER     =0x04 |AEETSUPPS_ERR_BM(AEETSUPPS_RETURN_ERROR_PROBLEM ),

   AEETSUPPS_ERR_BIG = 0x10000000
}AEETSuppsErrorType;

/*Supplementary Service Data*/
typedef struct
{
   uint32                           length;
   char                             *data;
} AEETSuppsData;

/* Network SS Codes   
** Note:  Only aoci, aocc are used for now  
*/
typedef enum {
   AEETSUPPS_CODE_CLIP                       =   0x11, /* calling_line_identification_presentation_service */
   AEETSUPPS_CODE_CLIR                       =   0x12, /* calling_line_identification_restriction_service presentation_service */
   AEETSUPPS_CODE_COLP                       =   0x13, /* connected_line_identification_presentation_service */
   AEETSUPPS_CODE_COLR                       =   0x14, /* connected_line identification_restriction_service */
   AEETSUPPS_CODE_ALL_FORWARDING_SS          =   0x20, /* all_call_forwarding */
   AEETSUPPS_CODE_CFU                        =   0x21, /*  call_forwarding_unconditional */
   AEETSUPPS_CODE_ALL_CONDFWD_SS             =   0x28, /* all conditional call forwarding  */
   AEETSUPPS_CODE_CFB                        =   0x29, /* call_forwarding_on_mobile_subscriber_busy */
   AEETSUPPS_CODE_CFNRY                      =   0x2a, /* call_forwarding_on_no_reply */
   AEETSUPPS_CODE_CFNRC                      =   0x2b, /* call_forwarding_on_mobile_subscriber_unreachable */
   AEETSUPPS_CODE_CW                         =   0x41, /* call waiting */
   AEETSUPPS_CODE_ALL_CALL_RSTRCT_SS         =   0x90,
   AEETSUPPS_CODE_BARRING_OUTGOING_CALLS     =   0x91,
   AEETSUPPS_CODE_BAOC                       =   0x92, /* barring_of_all_outgoing_calls */
   AEETSUPPS_CODE_BOIC                       =   0x93, /* barring_of_outgoing_international_calls */
   AEETSUPPS_CODE_BOIC_EXHC                  =   0x94, /* barring_of_outgoing_international_calls_except_those_to_home_plmn */
   AEETSUPPS_CODE_BARRING_OF_INCOMING_CALLS  =   0x99,
   AEETSUPPS_CODE_BAIC                       =   0x9a, /* barring of all incoming calls */
   AEETSUPPS_CODE_BICROAM                    =   0x9b, /* barring of incomming calls when roaming outside home PLMN Country */
   AEETSUPPS_CODE_BIG                        =   0x10000000
} AEETSuppsCodeType;

/* Basic Service Codes */
typedef enum {
   AEETSUPPS_BASIC_SERVICE_ALL = 0,                   /*All Basic Services*/

   /* BEARER-SERVICES */
   AEETSUPPS_BASIC_SERVICE_ALL_BEARER,                /*All Bearer Services*/
   AEETSUPPS_BASIC_SERVICE_ALL_ASYNCHRONOUS,          /*All Asynchrnous Services*/
   AEETSUPPS_BASIC_SERVICE_ALL_SYNCHRONOUS,           /*All Synchronous services*/

   /* TELE-SERVICES */
   AEETSUPPS_BASIC_SERVICE_ALL_TELESERVICES,          /*All TeleServices*/ 
   AEETSUPPS_BASIC_SERVICE_ALL_SPEECH_TRANSMISSION,   /*All Voice*/
   AEETSUPPS_BASIC_SERVICE_ALL_SMS,                   /*All SMS*/
   AEETSUPPS_BASIC_SERVICE_ALL_FAX,                   /*All Fax*/ 
   AEETSUPPS_BASIC_SERVICE_BIG = 0x10000000    
}AEETSuppsBasicServiceType;

/*Type of end result data in a transaction.*/
typedef enum
{
   AEETSUPPS_FWD_INFO = 1,
   AEETSUPPS_FWD_FEATURE_LIST_INFO,
   AEETSUPPS_CALL_BARRING_INFO,
   AEETSUPPS_CLI_RESTRICTION_INFO,
   AEETSUPPS_CUG_INFO,
   AEETSUPPS_BSG_LIST_INFO,
   AEETSUPPS_USS_DATA_INFO,
   AEETSUPPS_USSD_DATA_INFO,
   AEETSUPPS_NEW_PASSWD_INFO,
   AEETSUPPS_SS_DATA_INFO,
   AEETSUPPS_SS_STATUS_INFO,
   AEETSUPPS_SS_ERROR_INFO,
   AEETSUPPS_UNKNOWN_CONF_INFO, 
   AEETSUPPS_CC_CAUSE_INFO,
   AEETSUPPS_NO_INFO,
   AEETSUPPS_DEVICE_IMEI,
   AEETSUPPS_PIN_INFO,
   AEETSUPPS_RES_BIG = 0x10000000
} AEETSuppsResultType;

/* Result of pin block/unblock request */
typedef enum {
   AEETSUPPS_PIN_SUCCESS,
   AEETSUPPS_PIN_ERR_INCOMPATIBLE,
   AEETSUPPS_PIN_ERR_BLOCKED,
   AEETSUPPS_PIN_ERR_INCORRECT,
   AEETSUPPS_PIN_ERR_UNKNOWN,
   AEETSUPPS_PIN_ERR_BIG = 0x10000000
}AEETSuppsPinStatus;

/*Operation Status Received from the network*/
typedef struct {
   boolean                         ss_operative;
   boolean                         ss_provisioned;
   boolean                         ss_registered;
   boolean                         ss_active;
} AEETSuppsOpStatus;

/*CLI Restrict Option  Types*/
typedef enum {
   AEETSUPPS_CLI_OPTION_DEFAULT,   /*Default Option*/
   AEETSUPPS_CLI_OPTION_RESTRICT,  /*Restricted Option*/
   AEETSUPPS_CLI_OPTION_OVERRIDE,  /*Override Option*/
   AEETSUPPS_CLI_OPTION_UNKNOWN,   /*Unknown Option*/
   AEETSUPPS_CLI_OPTION_BIG = 0x10000000
} AEETSuppsCliOptionType;

/*Caller ID Display Options*/
typedef enum {
   AEETSUPPS_CLI_RESTRICTION_PERMANENT,
   AEETSUPPS_CLI_RESTRICTION_TEMPORARY_DEFAULT,
   AEETSUPPS_CLI_RESTRICTION_TEMPORARY_ALLOWED,
   AEETSUPPS_CLI_RESTRICTION_BIG = 0x10000000
}AEETSuppsCliRestrictOptionType;

/*CLI Info Received From the Network*/
typedef struct {
   AEETSuppsOpStatus                   ss_status;
   AEETSuppsCliRestrictOptionType      cli_restriction_option;
} AEETSuppsCliRestrictInfo;

/*Susbcription Info Received from the Network*/
typedef struct {
   AEETSuppsCliOptionType                option_type;
   union {
      AEETSuppsCliRestrictOptionType      cli_restrict;
      boolean                             override_category;
   } option;
} AEETSuppsSubscriptionOption;

/* enum for forwarding_reason */
typedef enum
{
   AEETSUPPS_FWD_REASON_MS_NOT_REACHABLE,
   AEETSUPPS_FWD_REASON_MS_BUSY,
   AEETSUPPS_FWD_REASON_NO_REPLY,
   AEETSUPPS_FWD_REASON_UNCONDITIONAL,
   AEETSUPPS_FWD_REASON_FWD_REASON_NONE,
   AEETSUPPS_FWD_REASON_MAX_FWD_REASON = 0x10000000
}AEETSuppsFwdReasonType;

/* connected number  */
typedef struct {
   AEETSuppsFwdReasonType           fwd_reason;
   boolean                          notification_to_fp;
   boolean                          notification_to_cp;
} AEETSuppsForwardingOption;

/*Forwarding Feature Info*/
typedef struct {
   AEETSuppsBasicServiceType        basic_service;
   AEETSuppsOpStatus                ss_status;
   AEETSuppsData                    fwd_to_number;  
   AEETSuppsData                    long_fwd_to_number;
   AEETSuppsForwardingOption        fwd_option;
   uint32                           timer_value;
   AEETSuppsData                    fwd_to_subaddress;
} AEETSuppsFwdFeature;

typedef struct {
   uint32                           length;
   AEETSuppsFwdFeature              fwd_feature[AEETSUPPS_FWD_FEATURE_LIST_SIZE];
} AEETSuppsFwdFeatureList;

typedef struct {
   AEETSuppsCodeType                ss_code;
   AEETSuppsFwdFeatureList          feature_list;
} AEETSuppsForwardingInfo;

/*Call Barring Info*/
typedef struct {
   AEETSuppsBasicServiceType           basic_service;
   AEETSuppsOpStatus                   ss_status;
} AEETSuppsCallBarringFeature;

typedef struct {
   AEETSuppsCodeType                   ss_code;
   uint32                              length;
   AEETSuppsCallBarringFeature         call_barring_feature_list[AEETSUPPS_CALL_BARRING_LIST_SIZE];
} AEETSuppsCallBarringInfo;

/*List of Basic Service Groups*/
typedef struct {
   int                                 length;
   AEETSuppsBasicServiceType           bsg_list[AEETSUPPS_BASIC_SERV_GROUP_LIST_SIZE];
} AEETSuppsBasicServiceGroupListInfo;

/*Supplmentary Service Data*/
typedef struct
{
   uint32                              length;
   AEETSuppsCodeType                   ss_code;
   AEETSuppsOpStatus                   ss_status;
   AEETSuppsSubscriptionOption         ss_subscription_option;
   AEETSuppsBasicServiceGroupListInfo  basic_service_group_list;

} AEETSuppsDataInfo;

/* This data structure represents the end result of the transaction. */
typedef struct
{
   AEETSuppsResultType       result_type;
   boolean                   success;
   union
      {
      AEETSuppsForwardingInfo                fwd_info;                           /*AEETSUPPS_FWD_INFO*/
      AEETSuppsFwdFeatureList                fwd_feature_list;                   /*AEETSUPPS_FWD_FEATURE_LIST_INFO*/
      AEETSuppsCallBarringInfo               call_barring_info;                  /*AEETSUPPS_CALL_BARRING_INFO*/
      AEETSuppsCliRestrictInfo               cli_restriction;                    /*AEETSUPPS_CLI_RESTRICTION_INFO*/
      AEETSuppsData                          cug_info;                           /*AEETSUPPS_CUG_INFO*/
      AEETSuppsBasicServiceGroupListInfo     bsg_list_info;                      /*AEETSUPPS_BSG_LIST_INFO*/
      AEETSuppsData                          uss_data_info;                      /*AEETSUPPS_USS_DATA_INFO*/
      AEETSuppsData                          ussd_data_info;                     /*AEETSUPPS_USSD_DATA_INFO*/
      char                                   ss_new_pwd[AEETSUPPS_MAX_PASSWD_LEN];  /*AEETSUPPS_NEW_PWD_INFO*/
      AEETSuppsDataInfo                      ss_data;                            /*AEETSUPPS_SS_DATA_INFO*/
      AEETSuppsErrorType                     ss_error;                           /*AEETSUPPS_SS_ERROR_INFO*/
      AEETSuppsOpStatus                      ss_status;                          /*AEETSUPPS_SS_STATUS_INFO*/
      uint32 /*AEETEndCause*/                cc_cause;                           /*AEETSUPPS_CC_CAUSE_INFO*/
      char                                   imei[AEETSUPPS_MAX_IMEI_LEN];       /*AEETSUPPS_DISPLAY_IMEI */
      AEETSuppsPinStatus                     pin_status;                         /*AEETSUPPS_PIN_INFO*/
   }data;
} AEETSuppsResult;

typedef enum {
   AEETSUPPS_STATE_NONE,                  /* when this transaction is not started. */
   AEETSUPPS_STATE_RUNNING,               /* when mobile is executing the transaction. */
   AEETSUPPS_STATE_NW_INDICATION,         /* network sent a query. */
   AEETSUPPS_STATE_DONE,                  /* transaction is complete or aborted with errors. */

   AEETSUPPS_STATE_BIG = 0x10000000
}AEETSuppsTransState;

/*Supplementary Service Operations*/
typedef enum
{
   AEETSUPPS_REQ_CHANGE_PIN,         /*Change Pin*/                  //@@@ take passwd. Not network commands communicated to SIM
   AEETSUPPS_REQ_UNBLOCK_PIN,        /*Unblock Pin*/                 //@@@ take passwd.  - do -
   AEETSUPPS_REQ_DEVICE_IMEI,        /*Get IMEI*/                    //@@@ no params. Comes from NV.
   AEETSUPPS_REQ_REGISTER,           /*Register Operation*/          //@@@ takes AEETSUPPSRegistration.
   AEETSUPPS_REQ_ERASE,              /*Erase Operation*/             //@@@ AEETSUPPSSSCodeType
   AEETSUPPS_REQ_ACTIVATE,           /*Activate Operation*/          //@@@ AEETSUPPSSSCodeType and AEETSUPPSBasicServiceType
   AEETSUPPS_REQ_DEACTIVATE,         /*Deactivate Operation*/        //@@@ same as activate.
   AEETSUPPS_REQ_INTERROGATE,        /*Interrogate Operation*/       //@@@ same as activate.
   AEETSUPPS_REQ_REGISTER_PASSWD,    /*Register the password*/       //@@@ AEETSUPPSSSCodeType and AEETSUPPSPassword
   AEETSUPPS_REQ_USS,                /*USSD Request*/                //@@@ AEETSUPPSData
   AEETSUPPS_REQ_NETWORK_IND,        /*Get Network Indication.*/     //@@@ no params.
   AEETSUPPS_REQ_BIG =  0x10000000
}AEETSuppsRequestType;

/*Password Information*/
typedef struct {
   char      szCurPasswd[AEETSUPPS_MAX_PASSWD_LEN];
   char      szNewPasswd[AEETSUPPS_MAX_PASSWD_LEN];
   char      szNewPasswdRepeated[AEETSUPPS_MAX_PASSWD_LEN];
}AEETSuppsChangePassword;

/*Registration Information*/
typedef struct {
   AEETSuppsData data;
   uint32    nr_timer;
}AEETSuppsRegistration;

/*Supplementary Service Mobile initiated request*/
typedef struct
{
   AEETSuppsRequestType           operation;
   AEETSuppsCodeType              code;
   AEETSuppsBasicServiceType      basic_service; 

   union {
      AEETSuppsRegistration      reg;
      AEETSuppsChangePassword    passwd;
      AEETSuppsData              ussd;
   }req;

}AEETSuppsRequest;

/* Types of messages Network indication contain */
typedef enum {
   AEETSUPPS_IND_ENTER_PASSWD,                        /* No data */
   AEETSUPPS_IND_ENTER_NEW_PASSWD,                    /* No data */
   AEETSUPPS_IND_ENTER_NEW_PASSWD_AGAIN,              /* No data */
   AEETSUPPS_IND_FWD_CHECK,
   AEETSUPPS_IND_USS,                                 /* ind_data present */
   AEETSUPPS_IND_USS_NOTIFY,                          /* ind_data present */

   AEETSUPPS_IND_BIG = 0x10000000
} AEETSuppsNetworkIndType;

typedef struct {
   AEETSuppsTransId              transaction_id;
   AEETSuppsNetworkIndType       ind_type; 
}AEETSuppsEventData;

/* USS response types*/
typedef enum
{
   AEETSUPPS_RES_PASSWD,                  /* for one of 
                                          ** AEETSUPPS_IND_ENTER_PASSWD, 
                                          ** AEETSUPPS_IND_ENTER_NEW_PASSWD, 
                                          ** AEETSUPPS_IND_ENTER_NEW_PASSWD_AGAIN */
   AEETSUPPS_RES_USS_UNKNOWN_ALPHABET,    /* for AEETSUPPS_IND_USS unknown alphabet */
   AEETSUPPS_RES_USS_BUSY_DISP,           /* for AEETSUPPS_IND_USS display is busy  */
   AEETSUPPS_RES_USS_OK,                  /* ACK for AEETSUPPS_IND_USS */
   AEETSUPPS_RES_USS_NONE,                /* no response */
   AEETSUPPS_RES_USS_BIG = 0x10000000
} AEETSuppsResType;

/*Supplementary Service Response Info*/
typedef struct {
   AEETSuppsResType           response_type;
   AEETSuppsData              response_data;
}AEETSuppsResponse;

/*Supplementary Service Indication sent by the Network */
typedef struct {
   AEETSuppsNetworkIndType      ind_type;
   AEETSuppsData                ind_data;
}AEETSuppsNetworkInd;

typedef enum {
   AEETSUPPS_STATUS_IND,
   AEETSUPPS_STATUS_COMPLETE,

   AEETSUPPS_STATUS_BIG = 0x10000000
}AEETSuppsStatusType;

/* status information. */
typedef struct {
   AEETSuppsStatusType   status;
   
   union {
      AEETSuppsNetworkInd  NetworkInd;          /* An indication or a query from Network */
      AEETSuppsResult      Result;              /* result of the transaction. */
   } data;
}AEETSuppsStatus;

typedef enum {

   AEETSUPPS_MSG_REQUEST,
   AEETSUPPS_MSG_RESPONSE,

   AEETSUPPS_MSG_BIG = 0x10000000

}AEETSuppsMessageType;

typedef struct {
   AEETSuppsMessageType type;
   union {
      AEETSuppsRequest  request;
      AEETSuppsResponse response;
   }data;
} AEETSuppsMessage;

/*
=======================================================================
  DATA STRUCTURE DOCUMENTATION
======================================================================= 

AEETSuppsMessageType

Description:
   Specifies the type of message.

Definition:
typedef enum {
   AEETSUPPS_MSG_REQUEST,
   AEETSUPPS_MSG_RESPONSE,
}AEETSuppsMessageType;

Members:
   AEETSUPPS_MSG_REQUEST   : Message is a request.
   AEETSUPPS_MSG_RESPONSE  : Message is in response to a network indication.

Comments: 
   None

See Also:
   None

=======================================================================

AEETSuppsMessage

Description:
   Represents a message for the transaction.

Definition:
typedef struct {
   AEETSuppsMessageType type;
   union {
      AEETSuppsRequest  request;
      AEETSuppsResponse response;
   }data;
} AEETSuppsMessage;

Members:
   type : The message type. Indicates the valid members of data.
   data.request : specifies a request to process.
   data.response : specifies a response to a network indication.
   
Comments: 
   None

See Also:
   None

=======================================================================

AEETSuppsStatus

Description:
   A status result of transaction

Definition:
typedef struct {
   AEETSuppsStatusType   status;
   
   union {
      AEETSuppsNetworkInd  NetworkInd;
      AEETSuppsResult      Result;
   } data;
}AEETSuppsStatus;

Members:
   status : type of status. Indicates the valid members of data.
   data.NetworkInd : specifies the network indication. Mobile must respond to this query.
   data.Result : specifies the data for a completed transaction.
   
Comments: 
   None

See Also:
   None

=======================================================================

AEETSuppsStatusType

Description:
   Type of status.

Definition:
typedef enum {
   AEETSUPPS_STATUS_IND,
   AEETSUPPS_STATUS_COMPLETE,
}AEETSuppsStatusType;

Members:
   AEETSUPPS_STATUS_IND : specifies Network indication is present status.
   AEETSUPPS_STATUS_COMPLETE : specifies transaction is complete with a result in status.
   
Comments: 
   None

See Also:
   None

=======================================================================

AEETSuppsNetworkInd

Description:
   Data structure representing network indication.

Definition:
typedef struct {
   AEETSuppsNetworkIndType      ind_type;
   AEETSuppsData                ind_data;
}AEETSuppsNetworkInd;

Members:
   ind_type : specifies the type of indication.
   ind_data : the corresponding data.
      
Comments: 
   None

See Also:
   None

=======================================================================

AEETSuppsNetworkIndType

Description:
   Specifies the type of network indication.

Definition:
typedef enum {
   AEETSUPPS_IND_ENTER_PASSWD,
   AEETSUPPS_IND_ENTER_NEW_PASSWD,
   AEETSUPPS_IND_ENTER_NEW_PASSWD_AGAIN,
   AEETSUPPS_IND_FWD_CHECK,
   AEETSUPPS_IND_USS,
   AEETSUPPS_IND_USS_NOTIFY,
} AEETSuppsNetworkIndType;

Members:
   AEETSUPPS_IND_ENTER_PASSWD :   network requesting current password.
   AEETSUPPS_IND_ENTER_NEW_PASSWD : Send a new password. mobile intends to change the password.
   AEETSUPPS_IND_ENTER_NEW_PASSWD_AGAIN : repeat the new password.
   AEETSUPPS_IND_FWD_CHECK :
   AEETSUPPS_IND_USS : USSD message to just prompt the user.
   AEETSUPPS_IND_USS_NOTIFY : USSD message to process.

Comments: 
   None

See Also:
   None

=======================================================================
*/

#endif /* !AEETSUPPSTYPES_H */
