APN policy group provides policies for APN control.
More...
|
mdm_result_t | mdm_create_apn_settings (mdm_apn_auth_type_t authType, char *p_apn, char *p_proxy, char *p_user, char *p_password, char *p_type) |
| API to create an APN setting. More...
|
|
mdm_result_t | mdm_delete_apn (int n_id) |
| API to delete an APN setting. More...
|
|
mdm_data_t * | mdm_get_apn_list (void) |
| API to get all of the APN settings from the device. More...
|
|
mdm_data_t * | mdm_get_apn_settings (int n_id) |
| API to get the settings for a particular APN. More...
|
|
mdm_data_t * | mdm_get_preferred_apn_settings (void) |
| API to get the user's preferred APN settings. More...
|
|
mdm_result_t | mdm_set_preferred_apn (int n_id) |
| API to set the preferred APN. More...
|
|
mdm_result_t | mdm_update_apn_settings (int n_id, mdm_apn_auth_type_t authType, char *p_apn, char *p_proxy, char *p_user, char *p_password, char *p_type) |
| API to update an APN setting. More...
|
|
APN policy group provides policies for APN control.
APN policy group.
Required Header
#include <mdm.h>
Overview
This group provides APIs to create, update and remove APN settings on the device.
APN auth type.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- See also
- mdm_create_apn_settings, mdm_update_apn_settings
Enumerator |
---|
MDM_NET_PDP_AUTH_NONE |
No authentication
|
MDM_NET_PDP_AUTH_PAP |
PAP authentication
|
MDM_NET_PDP_AUTH_CHAP |
CHAP authentication
|
Definition at line 38 of file apn.h.
API to create an APN setting.
- Attention
- Deprecated Since Knox_wearable 2.3.0. Use connection_add_profile instead.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- An Access Point Name (APN) is the name of a gateway that allows a user to access the Internet using the mobile phone network.
An admin can use this function to create an APN on the device without user interaction; filling it with the configuration parameters required to access a carrier's data network.
(char *)"test.sktelecom.com",
(char *)"10.103.230.150:9093:0",
(char *)"guest",
(char *)"1234",
(char *)"internet");
} else {
}
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.apn
- Parameters
-
[in] | authType | The APN authentication type. One of mdm_apn_auth_type_t . |
[in] | p_apn | The APN (for example, "test.sktelecom.com"). |
[in] | p_proxy | Proxy to use for web traffic (for example, "10.103.230.150:9093:0"). |
[in] | p_user | Username, if applicable (for example, "guest"). |
[in] | p_password | Password, if applicable (for example, "1234"). |
[in] | p_type | The type(s) of data connection that should use this set of APN settings. Two types are currently supported: "internet" and "MMS". |
- Returns
- mdm_result_t :
MDM_RESULT_SUCCESS
on success. Otherwise, returns another of the return values.
- Return values
-
- Permission:
- Usage of this API is restricted to registered clients only.
- See also
- mdm_delete_apn, mdm_update_apn_settings
API to delete an APN setting.
- Attention
- Deprecated Since Knox_wearable 2.3.0. Use connection_remove_profile instead.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- An admin can use this API to delete an APN from the device without user interaction using the APN ID. The APN ID can be obtained calling any of the APIs provided to get a list of APNs.
int apn_id = -1;
if (_data) {
GList *apn_data_list = (GList *)_data->
data;
if (apn_data_list) {
apn_data_list = g_list_first(apn_data_list);
while (apn_data_list) {
if (apn_settings) {
if (g_strcmp0(apn_settings->
p_name,
"testAPN") == 0)
{
apn_id = apn_settings->
id;
break;
}
}
apn_data_list = g_list_next(apn_data_list);
}
}
} else {
}
} else {
}
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.apn
- Parameters
-
[in] | n_id | The APN settings ID. |
- Returns
- mdm_result_t :
MDM_RESULT_SUCCESS
on success. Otherwise, returns another of the return values.
- Return values
-
- Permission:
- Usage of this API is restricted to registered clients only.
- See also
- mdm_create_apn_settings
-
mdm_get_apn_list
-
mdm_get_preferred_apn_settings
API to get all of the APN settings from the device.
- Attention
- Deprecated Since Knox_wearable 2.3.0. Use connection_get_profile_iterator instead.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can call this API to get the list of APNs that are provisioned on the device.
if (lp_data) {
GList *lp_list = (GList *)lp_data->
data;
if (lp_list) {
lp_list = g_list_first(lp_list);
while (lp_list) {
if (pl_apn_settings_t) {
printf("[%d.%s]. type:%s,
auth:%d,
apn:%s,
mmsProxy:%s:%s,
mmsc:%s,
mcc:%s,
mnc:%s,
name:%s,
pwd:%s,
proxy:%s:%d,
server:%s,
user:%s",
pl_apn_settings_t->
p_apn,
pl_apn_settings_t->
p_mcc,
pl_apn_settings_t->
p_mnc,
pl_apn_settings_t->port,
}
lp_list = g_list_next(lp_list);
}
}
} else {
}
- Returns
- A pointer to the APN settings data on success, NULL otherwise.
- See also
- mdm_get_apn_settings
API to get the settings for a particular APN.
- Attention
- Deprecated Since Knox_wearable 2.3.0. Use connection_get_profile_iterator instead.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- The admin can call this API to get the APN settings configured on the device.
if (lp_data) {
if (pl_apn_settings_t) {
printf("[%s : %s].
auth:%d,
apn:%s,
mmsProxy:%s:%s,
mmsc:%s,
mcc:%s,
mnc:%s,
name:%s,
pwd:%s,
proxy:%s:%d,
server:%s,
user:%s",
pl_apn_settings_t->
p_apn,
pl_apn_settings_t->
p_mcc,
pl_apn_settings_t->
p_mnc,
pl_apn_settings_t->port,
}
} else {
}
- Parameters
-
[in] | n_id | The ID of the APN settings to retrieve. |
- Returns
- A pointer to the APN settings data on success, NULL otherwise.
- See also
- mdm_get_apn_list
mdm_data_t* mdm_get_preferred_apn_settings |
( |
void |
| ) |
|
API to get the user's preferred APN settings.
- Attention
- Deprecated Since Knox_wearable 2.3.0. Use connection_get_default_cellular_service_profile instead.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can use this API to get the user's preferred (active) APN from the device.
if (lp_data) {
GList *lp_list = (GList *)lp_data->
data;
if(lp_list) {
lp_list = g_list_first(lp_list);
while (lp_list) {
if (pl_apn_settings_t) {
printf("[%s : %s].
auth:%d,
apn:%s,
mmsProxy:%s:%s,
mmsc:%s,
mcc:%s,
mnc:%s,
name:%s,
pwd:%s,
proxy:%s:%d,
server:%s,
user:%s",
pl_apn_settings_t->
p_apn,
pl_apn_settings_t->
p_mcc,
pl_apn_settings_t->
p_mnc,
pl_apn_settings_t->port,
}
lp_list = g_list_next(lp_list);
}
}
}
- Returns
- A pointer to the preferred APN data on success, NULL on error.
- See also
- mdm_set_preferred_apn
API to set the preferred APN.
- Attention
- Deprecated Since Knox_wearable 2.3.0. Use connection_set_default_cellular_service_profile instead.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- The device attempts to use the preferred APN whenever a connection to an APN is requested. If it's not possible to connect to the preferred APN with the given ID, then another APN is chosen from the available list by the system.
To use this API first you need to get an ID for a specific APN. You can obtain the ID from any of the APNs in the lists retrieved by mdm_get_preferred_apn_settings
ans mdm_get_apn_list
.
int apn_id = -1;
if (lp_data) {
GList *lp_list = (GList *)lp_data->
data;
if (lp_list) {
lp_list = g_list_first(lp_list);
while (lp_list) {
if (pl_apn_settings_t) {
if (g_strcmp0(pl_apn_settings_t->
p_name,
"testAPN")
{
apn_id = pl_apn_settings_t->
id;
break;
}
}
lp_list = g_list_next(lp_list);
}
}
} else {
}
} else {
}
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.apn
- Parameters
-
[in] | n_id | The ID of the APN settings to set as the preferred APN. |
- Returns
- mdm_result_t :
MDM_RESULT_SUCCESS
on success. Otherwise, returns another of the return values.
- Return values
-
- Permission:
- Usage of this API is restricted to registered clients only.
- See also
- mdm_get_preferred_apn_settings
-
mdm_get_apn_list
mdm_result_t mdm_update_apn_settings |
( |
int |
n_id, |
|
|
mdm_apn_auth_type_t |
authType, |
|
|
char * |
p_apn, |
|
|
char * |
p_proxy, |
|
|
char * |
p_user, |
|
|
char * |
p_password, |
|
|
char * |
p_type |
|
) |
| |
API to update an APN setting.
- Attention
- Deprecated Since Knox_wearable 2.3.0. Use connection_update_profile instead.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- The admin can set the values of the APN and update the values for the APN entry on the device without any user interaction.
(char *)"test.sktelecom.com",
(char *)"10.103.230.150:9093:0",
(char *)"guest",
(char *)"1234",
(char *)"internet");
} else {
}
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.apn
- Parameters
-
[in] | n_id | The ID of the APN to update. |
[in] | authType | The APN authentication type. One of mdm_apn_auth_type_t . |
[in] | p_apn | The APN (for example, "test.sktelecom.com"). |
[in] | p_proxy | Proxy to use for web traffic (for example, "10.103.230.150:9093:0"). |
[in] | p_user | Username, if applicable (for example, "guest"). |
[in] | p_password | Password, if applicable (for example, "1234"). |
[in] | p_type | The type(s) of data connection that should use this set of APN settings. Two types are currently supported: "internet" and "MMS". |
- Returns
- mdm_result_t :
MDM_RESULT_SUCCESS
on success. Otherwise, returns another of the return values.
- Return values
-
- Permission:
- Usage of this API is restricted to registered clients only.
- See also
- mdm_create_apn_settings, mdm_delete_apn