Using IPHONE_CTL to Reboot Phone | developer.brewmp.com Using IPHONE_CTL to Reboot Phone | developer.brewmp.com

Developer

Using IPHONE_CTL to Reboot Phone

Forums:

Hello,

I'm trying to automatically reboot the phone, but am running into issues with the device not responding after I do this. Here is what I've done so far:

This is my init:

nRet = ISHELL_CreateInstance( m_pIShell,
AEECLSID_PHONECTL,
( void ** )&( m_pIPhoneCtl ) );
if ( AEE_SUCCESS != nRet || NULL == m_pIPhoneCtl )
{
DBGPRINTF_ERROR( "Create IPhoneCtl instance failed (%d)", nRet);
return false;
}

This is my freeappdata:

if ( NULL != m_pIPhoneCtl )
{
( void )IPHONECTL_Release( m_pIPhoneCtl );
m_pIPhoneCtl = NULL;
}

This is my listener that waits to see if we have changed operation modes:

if ( AEET_EVENT_PH_OPRT_MODE == pPhoneEvent->evCode )
{
if(AEET_OPRT_MODE_OFFLINE_CDMA == pPhoneEvent->ph.oprt_mode){
DBGPRINTF("MODE CHANGED");
pThis->ChangeMode(AEET_OPRT_MODE_RESET);
}
...

This is a function I created to change modes:

int ChangeMode(AEETOprtMode mode)
{
DBGPRINTF("MODE: %d", mode);
IPHONECTL_SetOperatingMode(m_pIPhoneCtl, mode);
return 0;
}

This changes the mode in my event handler:

ChangeMode(AEET_OPRT_MODE_OFFLINE_CDMA);

So, from what I understand, I'm supposed to change my operating mode to offline CDMA first, wait for it to change modes, then change the mode to reset it and wait. It seems simple enough, but apparently I'm having issues. Has anyone done this before or know how to do it?

Thanks for any help.

Phone can reset using ISHELL_Reset(). What is the exact requirement?

Phone can reset using ISHELL_Reset(). What is the exact requirement?

The problem with ISHELL_Reset is that it doesn't automatically restart the brew app.
I eventually found out that I needed to add a dependency in my MIF file to the PhoneCtl clsid and add the TAPI permission. Because I didn't have this dependency, it wasn't giving my app the right permissions. You can use the code in the first post to reset a phone in a more controlled manner.

The problem with ISHELL_Reset is that it doesn't automatically restart the brew app.
I eventually found out that I needed to add a dependency in my MIF file to the PhoneCtl clsid and add the TAPI permission. Because I didn't have this dependency, it wasn't giving my app the right permissions. You can use the code in the first post to reset a phone in a more controlled manner.