Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Disabling Automatic Connection - OEM Only

This topic describes how to prevent automatic connection to the WLAN.

The current implementation of the Call Manager is based on cellular network behavior. When the WLAN is enabled, the Call Manager tries to connect to the previous access point using the net_list and net_user_manual_sys files.

To prevent automatic connection to the access points in this file, you must remove the files or make this information invalid before enabling the WLAN.

Changing the net.c file

Besides removing net_list and net_user_manual_sys files from the EFS, net.c should be modified to prevent net_list and manual_net_sys from being updated if they get regenerated. If net_list file is required to support WPA-Enterprise or WPA2-Enterprise, net_list file can exist in EFS, but it should contain invalid access point information.

The net.c file can be found in the services\cm folder.

The following code snippets demonstrate suggested modifications to net.c:

At the top of the file find the following lines:

static const char* net_file = "brew/mod/net_list";
static const char* net_manual_sys_file = "brew/mod/net_user_manual_sys";

Add the following declarations:

// Workaround to prevent automatic connection in manual mode
// Bogus file location
static const char* net_file2 = "brew/net_list";
static const char* net_manual_sys_file2 = "brew/net_user_manual_sys";

Locate the function net_file_write() and replace the existing call to efs_open() . Change:

fd = efs_open( net_file, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE );

to:

fd = efs_open( net_file2, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE );

Locate the function net_file_write2() and replace the existing calls to efs_open(). Change:

if(file_type == NET_TYPE_PRIVATE_LIST)
{
   fd = efs_open( net_file, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
}
else
{
   fd = efs_open( net_manual_sys_file, O_WRONLY | O_CREAT,
                                       S_IREAD | S_IWRITE);
}
to:
if(file_type == NET_TYPE_PRIVATE_LIST)
{
   fd = efs_open( net_file2, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
}
else
{
   fd = efs_open( net_manual_sys_file2, O_WRONLY | O_CREAT,
                                        S_IREAD | S_IWRITE);
}