Cellular Mobile Context Service
[Mobile Services]


Detailed Description

This service groups the Cellular Mobile Context functions.


Defines

#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_DATA_CALL_START   ((AlpMblNotificationId) 5)
 A data call has been started for a cellular mobile context.
#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_DATA_CALL_STOP   ((AlpMblNotificationId) 6)
 A data call has been stopped for a cellular mobile context.
#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_MANUFACTURER_AVAILABLE   ((AlpMblNotificationId) 1)
 The manufacturer information of a cellular mobile context is available.
#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_MOBILE_ID_AVAILABLE   ((AlpMblNotificationId) 4)
 The mobile id information of a cellular mobile context is available.
#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_MODEL_AVAILABLE   ((AlpMblNotificationId) 2)
 The model information of a cellular mobile context is available.
#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_REVISION_AVAILABLE   ((AlpMblNotificationId) 3)
 The revision information of a cellular mobile context is available.
#define ALP_MBL_CONTEXT_CELL_TYPE   "CELL"

Typedefs

typedef unsigned long AlpMblCncProfileId
typedef void(* AlpMblContextCellDataCallStartCallbackPtr )(void *iUserDataP, AlpMblContextId iMobileContextId, uint32_t iCncProfileId)
typedef void(* AlpMblContextCellDataCallStopCallbackPtr )(void *iUserDataP, AlpMblContextId iMobileContextId, uint32_t iCncProfileId)
typedef char AlpMblContextCellManufacturer [32]
typedef void(* AlpMblContextCellManufacturerAvailableCallbackPtr )(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellManufacturer iManufacturer)
typedef char AlpMblContextCellMobileId [32]
typedef void(* AlpMblContextCellMobileIdAvailableCallbackPtr )(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellMobileId iMobileId)
typedef char AlpMblContextCellModel [32]
typedef void(* AlpMblContextCellModelAvailableCallbackPtr )(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellModel iModel)
typedef char AlpMblContextCellRevision [32]
typedef void(* AlpMblContextCellRevisionAvailableCallbackPtr )(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellRevision iRevision)

Functions

alp_status_t alp_mbl_context_cell_get_cnc_profile_id (AlpMblContextId iContextId, AlpMblCncProfileId *oCncProfileIdP)
alp_status_t alp_mbl_context_cell_get_data_call (AlpMblContextId iContextId, AlpMblDataCallList *oDataCallListP)
alp_status_t alp_mbl_context_cell_get_from_cnc_profile_id (AlpMblCncProfileId iCncProfileId, AlpMblContextId *oContextIdP)
alp_status_t alp_mbl_context_cell_get_manufacturer (AlpMblContextId iContextId, AlpMblContextCellManufacturer *oManufacturerP)
alp_status_t alp_mbl_context_cell_get_mobile_id (AlpMblContextId iContextId, AlpMblContextCellMobileId *oMobileIdP)
alp_status_t alp_mbl_context_cell_get_model (AlpMblContextId iContextId, AlpMblContextCellModel *oModelP)
alp_status_t alp_mbl_context_cell_get_revision (AlpMblContextId iContextId, AlpMblContextCellRevision *oRevisionP)
alp_status_t alp_mbl_context_cell_ussd_send_answer (AlpMblContextId iContextId, char *iUssdAnswerP)
alp_status_t alp_mbl_context_cell_ussd_terminate (AlpMblContextId iContextId)


Define Documentation

#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_DATA_CALL_START   ((AlpMblNotificationId) 5)
 

A data call has been started for a cellular mobile context.

#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_DATA_CALL_STOP   ((AlpMblNotificationId) 6)
 

A data call has been stopped for a cellular mobile context.

#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_MANUFACTURER_AVAILABLE   ((AlpMblNotificationId) 1)
 

The manufacturer information of a cellular mobile context is available.

#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_MOBILE_ID_AVAILABLE   ((AlpMblNotificationId) 4)
 

The mobile id information of a cellular mobile context is available.

#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_MODEL_AVAILABLE   ((AlpMblNotificationId) 2)
 

The model information of a cellular mobile context is available.

#define ALP_MBL_CONTEXT_CELL_NOTIFICATION_REVISION_AVAILABLE   ((AlpMblNotificationId) 3)
 

The revision information of a cellular mobile context is available.

#define ALP_MBL_CONTEXT_CELL_TYPE   "CELL"
 


Typedef Documentation

typedef unsigned long AlpMblCncProfileId
 

typedef void(* AlpMblContextCellDataCallStartCallbackPtr)(void *iUserDataP, AlpMblContextId iMobileContextId, uint32_t iCncProfileId)
 

Callback prototype for ALP_MBL_CONTEXT_CELL_NOTIFICATION_DATA_CALL_START notification.

Parameters:
[in] iUserDataP - A pointer to user data info, given with the alp_mbl_add_observers() function call.
[in] iMobileContextId - The id of the mobile context associated to the data call.
[in] iCncProfileId - The Cnc profile id of the data call.

typedef void(* AlpMblContextCellDataCallStopCallbackPtr)(void *iUserDataP, AlpMblContextId iMobileContextId, uint32_t iCncProfileId)
 

Callback prototype for ALP_MBL_CONTEXT_CELL_NOTIFICATION_DATA_CALL_STOP notification.

Parameters:
[in] iUserDataP - A pointer to user data info, given with the alp_mbl_add_observers() function call.
[in] iMobileContextId - The id of the mobile context associated to the data call.
[in] iCncProfileId - The Cnc profile id of the data call.

typedef char AlpMblContextCellManufacturer[32]
 

typedef void(* AlpMblContextCellManufacturerAvailableCallbackPtr)(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellManufacturer iManufacturer)
 

Callback prototype for ALP_MBL_CONTEXT_CELL_NOTIFICATION_MANUFACTURER_AVAILABLE notification.

Parameters:
[in] iUserDataP - A pointer to user data info, given with the alp_mbl_add_observers() function call.
[in] iMobileContextId - The id of the mobile context that its manufacturer information become available.
[in] iManufacturer - The manufacturer information of the mobile context.

typedef char AlpMblContextCellMobileId[32]
 

typedef void(* AlpMblContextCellMobileIdAvailableCallbackPtr)(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellMobileId iMobileId)
 

Callback prototype for ALP_MBL_CONTEXT_CELL_NOTIFICATION_MOBILE_ID_AVAILABLE notification.

Parameters:
[in] iUserDataP - A pointer to user data info, given with the alp_mbl_add_observers() function call.
[in] iMobileContextId - The id of the mobile context that its mobile id information become available.
[in] iMobileId - The mobile id information of the mobile context.

typedef char AlpMblContextCellModel[32]
 

typedef void(* AlpMblContextCellModelAvailableCallbackPtr)(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellModel iModel)
 

Callback prototype for ALP_MBL_CONTEXT_CELL_NOTIFICATION_MODEL_AVAILABLE notification.

Parameters:
[in] iUserDataP - A pointer to user data info, given with the alp_mbl_add_observers() function call.
[in] iMobileContextId - The id of the mobile context that its model information become available.
[in] iModel - The model information of the mobile context.

typedef char AlpMblContextCellRevision[32]
 

typedef void(* AlpMblContextCellRevisionAvailableCallbackPtr)(void *iUserDataP, AlpMblContextId iMobileContextId, AlpMblContextCellRevision iRevision)
 

Callback prototype for ALP_MBL_CONTEXT_CELL_NOTIFICATION_REVISION_AVAILABLE notification.

Parameters:
[in] iUserDataP - A pointer to user data info, given with the alp_mbl_add_observers() function call.
[in] iMobileContextId - The id of the mobile context that its revision information become available.
[in] iRevision - The revision information of the mobile context.


Function Documentation

alp_status_t alp_mbl_context_cell_get_cnc_profile_id AlpMblContextId  iContextId,
AlpMblCncProfileId oCncProfileIdP
 

Get the Cnc Profile ID of a Cellular Mobile Context. This function is used if you want to use the Telephony Mgr API and Mobile Service API. It allows you to be sure to use the same phone module in both services.

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
[out] oCncProfileIdP - Pointer to an AlpMblCncProfileId, to store the Cnc Profile ID.
Returns:
ALP_STATUS_OK - The Cnc Profile ID has been retrieved successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist.

ALP_STATUS_MBL_INVALID_PARAMETER - oCncProfileIdP is NULL, and it's not valid.

Example:
An example of using both Mobile Services and Telephony Mgr APIs: retrievs the list of phonebook of the default context.
#include <stdio.h>
#include <string.h>
#include <alp/mobile.h>
#include <alp/mobile_context.h>
#include <alp/mobile_context_cellular.h>
#include <alp/telephony.h>
#include <alp/errormgr.h>

alp_status_t prv_list_phonebooks()
{
        AlpMblContextId         defaultContextId;
        AlpMblContextType       contextType;
        AlpMblCncProfileId      cncProfileId;
        AlpTelApplicationId     telAppId;
        AlpTelPhbPhonebooks     telPhonebooks;
        size_t                          i;
        alp_status_t            err;

        if ((err = alp_mbl_get_default_context(&defaultContextId)) != ALP_STATUS_OK)
        {
                printf("alp_mbl_get_default_context failed with error: %s.\n", alp_err_get_string(err, true));
                return err;
        }

        printf("The id of the default context is %d.\n", defaultContextId);

        if ((err = alp_mbl_context_get_type(defaultContextId, &contextType)) != ALP_STATUS_OK)
        {
                printf("alp_mbl_context_get_type failed with error: %s.\n", alp_err_get_string(err, true));
                return err;
        }

        printf("The type of the default context is %s.\n", contextType);

        if (strcmp(contextType, ALP_MBL_CONTEXT_CELL_TYPE) != 0)
        {
                printf("Invalid context type, only Cellular context can use Telephony Mgr APIs.\n");
                return ALP_STATUS_MBL_INVALID_OBJECT;
        }

        if ((err = alp_mbl_context_cell_get_cnc_profile_id(defaultContextId, &cncProfileId)) != ALP_STATUS_OK)
        {
                printf("alp_mbl_context_cell_get_cnc_profile_id failed with error: %s.\n", alp_err_get_string(err, true));
                return err;
        }

        if ((err = alp_tel_open_phone_profile(ALP_TEL_VERSION, cncProfileId, &telAppId)) != ALP_STATUS_OK)
        {
                printf("alp_tel_open_phone_profile failed with error: %s.\n", alp_err_get_string(err, true));
                return err;
        }

        telPhonebooks.count     = 20;
        telPhonebooks.idP       = (uint16_t*) malloc(sizeof(uint16_t) * telPhonebooks.count);

        if ((err = alp_tel_phb_get_phonebooks(telAppId, &telPhonebooks, NULL)) != ALP_STATUS_OK)
        {
                printf("alp_tel_phb_get_phonebooks failed with error: %s.\n", alp_err_get_string(err, true));
                (void) alp_tel_close(telAppId);
                free(telPhonebooks.idP);
                return err;
        }

        printf("Found %d phonebooks.\n", telPhonebooks.count);
        for ( i = 0 ; i < telPhonebooks.count ; i++ )
                printf(" Phonebook (%c%c).\n", (char) (telPhonebooks.idP[i] >> 8), (char) telPhonebooks.idP[i]);

        free(telPhonebooks.idP);

        if ((err = alp_tel_close(telAppId)) != ALP_STATUS_OK)
        {
                printf("alp_tel_close failed with error: %s.\n", alp_err_get_string(err, true));
                return err;
        }

        return ALP_STATUS_OK;
}
Since:
ALP iSDK 1.1

alp_status_t alp_mbl_context_cell_get_data_call AlpMblContextId  iContextId,
AlpMblDataCallList oDataCallListP
 

Gets the list of current data call of a Cellular Mobile Context.

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
[out] oDataCallListP - Pointer to an AlpMblDataCallList, to store the list of data call.
Returns:
ALP_STATUS_OK - The Cnc Profile ID has been retrieved successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist or its status is not ALP_MBL_CONTEXT_STATUS_CONNECTED.

ALP_STATUS_MBL_INVALID_PARAMETER - oDataCallListP is NULL, and it's not valid.

Since:
ALP iSDK 1.1

alp_status_t alp_mbl_context_cell_get_from_cnc_profile_id AlpMblCncProfileId  iCncProfileId,
AlpMblContextId oContextIdP
 

Get the id of a Cellular Mobile Context searching with the cnc profile id.

Parameters:
[in] iCncProfileId - Cnc Profile id to use for the search.
[out] oContextIdP - Pointer to an AlpMblContextId, to store the id of the Cellular Mobile Context.
Returns:
ALP_STATUS_OK - The direction has been retrieved successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist.

ALP_STATUS_MBL_INVALID_PARAMETER - oContextIdP is NULL, and it's not valid.

Since:
ALP iSDK 1.1

alp_status_t alp_mbl_context_cell_get_manufacturer AlpMblContextId  iContextId,
AlpMblContextCellManufacturer oManufacturerP
 

Get the manufacturer of a Cellular Mobile Context.

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
[out] oManufacturerP - Pointer to an AlpMblContextCellManufacturer, to store the manufacturer.
Returns:
ALP_STATUS_OK - The manufacturer has been retrieved successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist.

ALP_STATUS_MBL_INVALID_PARAMETER - oManufacturerP is NULL, and it's not valid.

Since:
ALP iSDK 1.1

alp_status_t alp_mbl_context_cell_get_mobile_id AlpMblContextId  iContextId,
AlpMblContextCellMobileId oMobileIdP
 

Get the mobile id of a Cellular Mobile Context (IMEI for GSM module).

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
[out] oMobileIdP - Pointer to an AlpMblContextCellMobileId, to store the mobile id (IMEI for GSM module).
Returns:
ALP_STATUS_OK - The mobile id has been retrieved successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist.

ALP_STATUS_MBL_INVALID_PARAMETER - oMobileIdP is NULL, and it's not valid.

Since:
ALP iSDK 1.1

alp_status_t alp_mbl_context_cell_get_model AlpMblContextId  iContextId,
AlpMblContextCellModel oModelP
 

Get the model of a Cellular Mobile Context.

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
[out] oModelP - Pointer to an AlpMblContextCellModel, to store the model.
Returns:
ALP_STATUS_OK - The model has been retrieved successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist.

ALP_STATUS_MBL_INVALID_PARAMETER - oModelP is NULL, and it's not valid.

Since:
ALP iSDK 1.1

alp_status_t alp_mbl_context_cell_get_revision AlpMblContextId  iContextId,
AlpMblContextCellRevision oRevisionP
 

Get the revision of a Cellular Mobile Context.

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
[out] oRevisionP - Pointer to an AlpMblContextCellRevision, to store the revision.
Returns:
ALP_STATUS_OK - The revision has been retrieved successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist.

ALP_STATUS_MBL_INVALID_PARAMETER - oRevisionP is NULL, and it's not valid.

Since:
ALP iSDK 1.1

alp_status_t alp_mbl_context_cell_ussd_send_answer AlpMblContextId  iContextId,
char *  iUssdAnswerP
 

Send an answer for an USSD session.

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
[in] iUssdAnswerP - A string which contains the USSD answer.
Returns:
ALP_STATUS_OK - The USSD answer has been sent successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist, its status is not ALP_MBL_CONTEXT_STATUS_CONNECTED, or there is no USSD session in progress.

ALP_STATUS_MBL_INVALID_PARAMETER - iUssdAnswerP is NULL, and it's not valid.

Since:
ALP iSDK 2.5

alp_status_t alp_mbl_context_cell_ussd_terminate AlpMblContextId  iContextId  ) 
 

Terminate an USSD session.

Parameters:
[in] iContextId - The id of the Cellular Mobile Context.
Returns:
ALP_STATUS_OK - The USSD session has been terminate successfully.

ALP_STATUS_MBL_IPC_ERROR - Communication problem between library and server.

ALP_STATUS_MBL_MEMORY_ERROR - System is out of enough memory.

ALP_STATUS_MBL_INVALID_OBJECT - The context id is not valid: the context doesn't exist, its status is not ALP_MBL_CONTEXT_STATUS_CONNECTED, or there is no USSD session in progress.

Since:
ALP iSDK 2.5


Generated on Wed Jul 30 07:06:43 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.