电话开启和电话关闭的命令

电话开启:RIL_SetEquipmentState(m_hRIL, RIL_EQSTATE_FULL);
电话关闭:RIL_SetEquipmentState(m_hRIL, RIL_EQSTATE_MINIMUM);
获得电话状态: RIL_GetEquipmentState(m_hRIL);

电话开启和电话关闭RIL监控事件:


//功能: RIL事件回调用函数
void CALLBACK RilNotifyCallBack( DWORD dwCode, const void* lpData, DWORD cbData, DWORD dwParam )
{
        RILEQUIPMENTSTATE dwReadyState;

        switch( dwCode )
       {

       case RIL_NOTIFY_RADIOEQUIPMENTSTATECHANGED:

              memset( &dwReadyState, 0, sizeof(RILEQUIPMENTSTATE) );
              memcpy( &dwReadyState, lpData, cbData );
              if( dwReadyState.dwReadyState == ( RIL_READYSTATE_INITIALIZED | RIL_READYSTATE_SIM ) )
              {
                     //电话开启RIL监控事件
              }
              else if((dwReadyState.dwParams &  RIL_PARAM_EQUIPMENTSTATE_RADIOSUPPORT)

                                                          ==   RIL_PARAM_EQUIPMENTSTATE_RADIOSUPPORT )

             {
                    if( dwReadyState.dwRadioSupport == RIL_RADIOSUPPORT_OFF )
                    {
                           //电话关闭RIL监控事件
                    }
             }

             break;

        default:
             break;
        }

        return;
}

posted @ 2009-09-27 17:13  木瓜脑袋  阅读(862)  评论(0编辑  收藏  举报