2012年6月26日火曜日

a file demonstrating how to use the RIL api

/* (C) 2003 XDA Developers  itsme@xs4all.nl   *   * Copyright 2001,2002,2003 NAH6 BV   * All Rights Reserved   *   * $Header$   */    #include <windows.h>    #include "debug.h"  #include "stringutils.h"  #include "ril.h"  #include "RilClass.h"    extern RilClass *g_ril;    std::string GetSimStatusChangedString(DWORD dwStatus);  std::string GetLockedStateString(DWORD dwLockedState);  std::string GetCallTypeString(int calltype);  std::string GetDisconnectInitString(int di);  std::string GetServiceInfoString(RILSERVICEINFO *si);  std::string GetRingInfoString(RILRINGINFO* ri);  std::string GetConnectInfoString(RILCONNECTINFO* ci);  std::string GetCallInfoString(RILCALLINFO* ci);  bool HandleCallControlRingEvent(RILRINGINFO* ri, DWORD cbdata);  bool HandleCallControlConnectEvent(RILCONNECTINFO* ci, DWORD cbdata);  bool HandleCallControlDisconnectEvent(DWORD* d, DWORD cbdata);  bool HandleCallControlDataServiceNegotiatedEvent(RILSERVICEINFO* si, DWORD cbdata);  std::string GetRilAddressString(RILADDRESS* ra);  std::string GetRilSubAddressString(RILSUBADDRESS* ra);  std::string GetRemotePartyInfoString(RILREMOTEPARTYINFO* pi);  bool HandleSupServiceCallerIdEvent(RILREMOTEPARTYINFO* pi, DWORD cbdata);  bool HandleSimtoolkitCommandEvent(BYTE* lpData, DWORD cbdata);  std::string GetRegistrationStatusString(int rs);  bool HandleNetworkGprsStatusChangedEvent(DWORD* d, DWORD cbdata);  bool HandleNetworkSystemChangedEvent(DWORD* d, DWORD cbdata);  bool HandleNetworkSystemCapsChangedEvent(DWORD* d, DWORD cbdata);  std::string GetRadioPresenceString(int rp);  std::string GetEquipmentStateString(RILEQUIPMENTSTATE* es);  std::string GetEquipmentInfoString(RILEQUIPMENTINFO* ei);  std::string GetRilSignalQuality(RILSIGNALQUALITY *sq);  std::string GetCallWaitingInfo(RILCALLWAITINGINFO *cw);  bool HandleRadioPresenceChangedEvent(DWORD* d, DWORD cbdata);  std::string GetRilMessageString(RILMESSAGE* m);  bool HandleMessageMessageEvent(RILMESSAGE* m, DWORD cbdata);  bool HandleCallStateChangedEvent(void *p, DWORD cbdata);  bool HandleCallProgressInfoEvent(RILCALLINFO*p, DWORD cbdata);  std::string GetDataEncodingSchemeString(RILMSGDCS *p);    std::string RilNClassString(DWORD code)  {      switch(NCLASS_FROM_NOTIFICATION(code))      {  case RIL_NCLASS_FUNCRESULT  : return "FUNCRESULT";  case RIL_NCLASS_CALLCTRL    : return "CALLCTRL";  case RIL_NCLASS_MESSAGE     : return "MESSAGE";  case RIL_NCLASS_NETWORK     : return "NETWORK";  case RIL_NCLASS_SUPSERVICE  : return "SUPSERVICE";  case RIL_NCLASS_PHONEBOOK   : return "PHONEBOOK";  case RIL_NCLASS_SIMTOOLKIT  : return "SIMTOOLKIT";  case RIL_NCLASS_MISC        : return "MISC";  case RIL_NCLASS_RADIOSTATE  : return "RADIOSTATE";  case RIL_NCLASS_DEVSPECIFIC : return "DEVSPECIFIC";  default:      return stringformat("NCLASS_%04x", (code>>16)&0xffff);      }  }    std::string RilResultString(HRESULT res)  {      switch(res)      {    case RIL_RESULT_OK:                               return "FUNCRESULT::OK";  case RIL_RESULT_NOCARRIER:                        return "FUNCRESULT::NOCARRIER";  case RIL_RESULT_ERROR:                            return "FUNCRESULT::ERROR";  case RIL_RESULT_NODIALTONE:                       return "FUNCRESULT::NODIALTONE";  case RIL_RESULT_BUSY:                             return "FUNCRESULT::BUSY";  case RIL_RESULT_NOANSWER:                         return "FUNCRESULT::NOANSWER";  case RIL_RESULT_CALLABORTED:                      return "FUNCRESULT::CALLABORTED";    case RIL_NOTIFY_RING:                             return "CALLCTRL::RING";  case RIL_NOTIFY_CONNECT:                          return "CALLCTRL::CONNECT";  case RIL_NOTIFY_DISCONNECT:                       return "CALLCTRL::DISCONNECT";  case RIL_NOTIFY_DATASVCNEGOTIATED:                return "CALLCTRL::DATASVCNEGOTIATED";  case RIL_NOTIFY_CALLSTATECHANGED:                 return "CALLCTRL::CALLSTATECHANGED";  case RIL_NOTIFY_EMERGENCYMODEENTERED:             return "CALLCTRL::EMERGENCYMODEENTERED";  case RIL_NOTIFY_EMERGENCYMODEEXITED:              return "CALLCTRL::EMERGENCYMODEEXITED";  case RIL_NOTIFY_EMERGENCYHANGUP:                  return "CALLCTRL::EMERGENCYHANGUP";  case RIL_NOTIFY_HSCSDPARAMSNEGOTIATED:            return "CALLCTRL::HSCSDPARAMSNEGOTIATED";  case RIL_NOTIFY_DIAL:                             return "CALLCTRL::DIAL";  case RIL_NOTIFY_CALLPROGRESSINFO:                 return "CALLCTRL::CALLPROGRESSINFO";  case RIL_NOTIFY_CURRENTLINECHANGED:               return "CALLCTRL::CURRENTLINECHANGED";  case RIL_NOTIFY_GPRS_DISCONNECT:                  return "CALLCTRL::GPRS_DISCONNECT";    case RIL_NOTIFY_MESSAGE:                          return "MESSAGE::MESSAGE";  case RIL_NOTIFY_BCMESSAGE:                        return "MESSAGE::BCMESSAGE";  case RIL_NOTIFY_STATUSMESSAGE:                    return "MESSAGE::STATUSMESSAGE";  case RIL_NOTIFY_MSGSTORED:                        return "MESSAGE::MSGSTORED";  case RIL_NOTIFY_MSGDELETED:                       return "MESSAGE::MSGDELETED";  case RIL_NOTIFY_MSGSTORAGECHANGED:                return "MESSAGE::MSGSTORAGECHANGED";  case RIL_NOTIFY_MESSAGE_IN_SIM:                   return "MESSAGE::MESSAGE_IN_SIM";  case RIL_NOTIFY_BCMESSAGE_IN_SIM:                 return "MESSAGE::BCMESSAGE_IN_SIM";  case RIL_NOTIFY_STATUSMESSAGE_IN_SIM:             return "MESSAGE::STATUSMESSAGE_IN_SIM";    case RIL_NOTIFY_REGSTATUSCHANGED:                 return "NETWORK::REGSTATUSCHANGED";  case RIL_NOTIFY_CALLMETER:                        return "NETWORK::CALLMETER";  case RIL_NOTIFY_CALLMETERMAXREACHED:              return "NETWORK::CALLMETERMAXREACHED";  case RIL_NOTIFY_GPRSREGSTATUSCHANGED:             return "NETWORK::GPRSREGSTATUSCHANGED";  case RIL_NOTIFY_SYSTEMCHANGED:                    return "NETWORK::SYSTEMCHANGED";  case RIL_NOTIFY_SYSTEMCAPSCHANGED:                return "NETWORK::SYSTEMCAPSCHANGED";  case (0x00000008 | RIL_NCLASS_NETWORK):           return "NETWORK::LOCATIONINFO";    case RIL_NOTIFY_CALLERID:                         return "SUPSERVICE::CALLERID";  case RIL_NOTIFY_DIALEDID:                         return "SUPSERVICE::DIALEDID";  case RIL_NOTIFY_CALLWAITING:                      return "SUPSERVICE::CALLWAITING";  case RIL_NOTIFY_SUPSERVICEDATA:                   return "SUPSERVICE::SUPSERVICEDATA";  case RIL_NOTIFY_INTERMEDIATESS:                   return "SUPSERVICE::INTERMEDIATESS";  case RIL_NOTIFY_UNSOLICITEDSS :                   return "SUPSERVICE::UNSOLICITEDSS";    case RIL_NOTIFY_PHONEBOOKENTRYSTORED:             return "PHONEBOOK::PHONEBOOKENTRYSTORED";  case RIL_NOTIFY_PHONEBOOKENTRYDELETED:            return "PHONEBOOK::PHONEBOOKENTRYDELETED";  case RIL_NOTIFY_PHONEBOOKSTORAGECHANGED:          return "PHONEBOOK::PHONEBOOKSTORAGECHANGED";    case RIL_NOTIFY_SIMTOOLKITCMD:                    return "SIMTOOLKIT::SIMTOOLKITCMD";  case RIL_NOTIFY_SIMTOOLKITCALLSETUP:              return "SIMTOOLKIT::SIMTOOLKITCALLSETUP";  case RIL_NOTIFY_SIMTOOLKITEVENT:                  return "SIMTOOLKIT::SIMTOOLKITEVENT";  case RIL_NOTIFY_SIMTOOLKITSESSIONEND:             return "SIMTOOLKIT::SIMTOOLKITSESSIONEND";    case RIL_NOTIFY_RADIOEQUIPMENTSTATECHANGED:       return "RADIOSTATE::RADIOEQUIPMENTSTATECHANGED";  case RIL_NOTIFY_RADIOPRESENCECHANGED:             return "RADIOSTATE::RADIOPRESENCECHANGED";    case RIL_NOTIFY_SIMNOTACCESSIBLE:                 return "MISC::SIMNOTACCESSIBLE";  case RIL_NOTIFY_DTMFSIGNAL:                       return "MISC::DTMFSIGNAL";  case RIL_NOTIFY_GPRSCLASS_NETWORKCHANGED:         return "MISC::GPRSCLASS_NETWORKCHANGED";  case RIL_NOTIFY_GPRSCLASS_RADIOCHANGED:           return "MISC::GPRSCLASS_RADIOCHANGED";  case RIL_NOTIFY_SIGNALQUALITY:                    return "MISC::SIGNALQUALITY";    case RIL_NOTIFY_MAINTREQUIRED   :                    return "MISC::MAINTREQUIRED";  case RIL_NOTIFY_PRIVACYCHANGED  :                    return "MISC::PRIVACYCHANGED";  case RIL_NOTIFY_SIM_DATACHANGE  :                    return "MISC::SIM_DATACHANGE";  case RIL_NOTIFY_ATLOGGING       :                    return "MISC::ATLOGGING";  case RIL_NOTIFY_SIMSTATUSCHANGED:                    return "MISC::SIMSTATUSCHANGED";    case RIL_NOTIFY_CELLID:                           return "DEVSPECIFIC::CELLID";    default:      return stringformat("%hs::%04x", RilNClassString(res).c_str(), res&0xffff);  }  }  std::string RilErrorClassString(DWORD dwErrorClass)  {      switch(dwErrorClass)      {  case RIL_ERRORCLASS_NONE: return "RIL_ERRORCLASS_NONE";  case RIL_ERRORCLASS_PASSWORD: return "RIL_ERRORCLASS_PASSWORD";  case RIL_ERRORCLASS_SIM: return "RIL_ERRORCLASS_SIM";  case RIL_ERRORCLASS_NETWORKACCESS: return "RIL_ERRORCLASS_NETWORKACCESS";  case RIL_ERRORCLASS_NETWORK: return "RIL_ERRORCLASS_NETWORK";  case RIL_ERRORCLASS_MOBILE: return "RIL_ERRORCLASS_MOBILE";  case RIL_ERRORCLASS_NETWORKUNSUPPORTED: return "RIL_ERRORCLASS_NETWORKUNSUPPORTED";  case RIL_ERRORCLASS_MOBILEUNSUPPORTED: return "RIL_ERRORCLASS_MOBILEUNSUPPORTED";  case RIL_ERRORCLASS_BADPARAM: return "RIL_ERRORCLASS_BADPARAM";  case RIL_ERRORCLASS_STORAGE: return "RIL_ERRORCLASS_STORAGE";  case RIL_ERRORCLASS_SMSC: return "RIL_ERRORCLASS_SMSC";  case RIL_ERRORCLASS_DESTINATION: return "RIL_ERRORCLASS_DESTINATION";  case RIL_ERRORCLASS_DESTINATIONUNSUPPORTED: return "RIL_ERRORCLASS_DESTINATIONUNSUPPORTED";  case RIL_ERRORCLASS_RADIOUNAVAILABLE: return "RIL_ERRORCLASS_RADIOUNAVAILABLE";    default:      return stringformat("RIL_ERRORCLASS_%02x", dwErrorClass);      }  }      std::string RilErrorString(DWORD dwError)  {      switch(dwError)      {  case RIL_E_PHONEFAILURE:              return "RIL_E_MOBILE::PHONEFAILURE";  case RIL_E_NOCONNECTION:              return "RIL_E_MOBILE::NOCONNECTION";  case RIL_E_LINKRESERVED:              return "RIL_E_MOBILE::LINKRESERVED";  case RIL_E_OPNOTALLOWED:              return "RIL_E_MOBILEUNSUPPORTED::OPNOTALLOWED";  case RIL_E_OPNOTSUPPORTED:            return "RIL_E_MOBILEUNSUPPORTED::OPNOTSUPPORTED";  case RIL_E_PHSIMPINREQUIRED:          return "RIL_E_PASSWORD::PHSIMPINREQUIRED";  case RIL_E_PHFSIMPINREQUIRED:         return "RIL_E_PASSWORD::PHFSIMPINREQUIRED";  case RIL_E_PHFSIMPUKREQUIRED:         return "RIL_E_PASSWORD::PHFSIMPUKREQUIRED";  case RIL_E_SIMNOTINSERTED:            return "RIL_E_SIM::SIMNOTINSERTED";  case RIL_E_SIMPINREQUIRED:            return "RIL_E_PASSWORD::SIMPINREQUIRED";  case RIL_E_SIMPUKREQUIRED:            return "RIL_E_PASSWORD::SIMPUKREQUIRED";  case RIL_E_SIMFAILURE:                return "RIL_E_SIM::SIMFAILURE";  case RIL_E_SIMBUSY:                   return "RIL_E_SIM::SIMBUSY";  case RIL_E_SIMWRONG:                  return "RIL_E_SIM::SIMWRONG";  case RIL_E_INCORRECTPASSWORD:         return "RIL_E_PASSWORD::INCORRECTPASSWORD";  case RIL_E_SIMPIN2REQUIRED:           return "RIL_E_PASSWORD::SIMPIN2REQUIRED";  case RIL_E_SIMPUK2REQUIRED:           return "RIL_E_PASSWORD::SIMPUK2REQUIRED";  case RIL_E_MEMORYFULL:                return "RIL_E_STORAGE::MEMORYFULL";  case RIL_E_INVALIDINDEX:              return "RIL_E_STORAGE::INVALIDINDEX";  case RIL_E_NOTFOUND:                  return "RIL_E_STORAGE::NOTFOUND";  case RIL_E_MEMORYFAILURE:             return "RIL_E_STORAGE::MEMORYFAILURE";  case RIL_E_TEXTSTRINGTOOLONG:         return "RIL_E_BADPARAM::TEXTSTRINGTOOLONG";  case RIL_E_INVALIDTEXTSTRING:         return "RIL_E_BADPARAM::INVALIDTEXTSTRING";  case RIL_E_DIALSTRINGTOOLONG:         return "RIL_E_BADPARAM::DIALSTRINGTOOLONG";  case RIL_E_INVALIDDIALSTRING:         return "RIL_E_BADPARAM::INVALIDDIALSTRING";  case RIL_E_NONETWORKSVC:              return "RIL_E_NETWORKACCESS::NONETWORKSVC";  case RIL_E_NETWORKTIMEOUT:            return "RIL_E_NETWORK::NETWORKTIMEOUT";  case RIL_E_EMERGENCYONLY:             return "RIL_E_NETWORKACCESS::EMERGENCYONLY";  case RIL_E_NETWKPINREQUIRED:          return "RIL_E_PASSWORD::NETWKPINREQUIRED";  case RIL_E_NETWKPUKREQUIRED:          return "RIL_E_PASSWORD::NETWKPUKREQUIRED";  case RIL_E_SUBSETPINREQUIRED:         return "RIL_E_PASSWORD::SUBSETPINREQUIRED";  case RIL_E_SUBSETPUKREQUIRED:         return "RIL_E_PASSWORD::SUBSETPUKREQUIRED";  case RIL_E_SVCPINREQUIRED:            return "RIL_E_PASSWORD::SVCPINREQUIRED";  case RIL_E_SVCPUKREQUIRED:            return "RIL_E_PASSWORD::SVCPUKREQUIRED";  case RIL_E_CORPPINREQUIRED:           return "RIL_E_PASSWORD::CORPPINREQUIRED";  case RIL_E_CORPPUKREQUIRED:           return "RIL_E_PASSWORD::CORPPUKREQUIRED";  case RIL_E_TELEMATICIWUNSUPPORTED:    return "RIL_E_NETWORKUNSUPPORTED::TELEMATICIWUNSUPPORT";  case RIL_E_SMTYPE0UNSUPPORTED:        return "RIL_E_SMSC::SMTYPE0UNSUPPORTED";  case RIL_E_CANTREPLACEMSG:            return "RIL_E_SMSC::CANTREPLACEMSG";  case RIL_E_PROTOCOLIDERROR:           return "RIL_E_SMSC::PROTOCOLIDERROR";  case RIL_E_DCSUNSUPPORTED:            return "RIL_E_SMSC::DCSUNSUPPORTED";  case RIL_E_MSGCLASSUNSUPPORTED:       return "RIL_E_SMSC::MSGCLASSUNSUPPORTED";  case RIL_E_DCSERROR:                  return "RIL_E_SMSC::DCSERROR";  case RIL_E_CMDCANTBEACTIONED:         return "RIL_E_SMSC::CMDCANTBEACTIONED";  case RIL_E_CMDUNSUPPORTED:            return "RIL_E_SMSC::CMDUNSUPPORTED";  case RIL_E_CMDERROR:                  return "RIL_E_SMSC::CMDERROR";  case RIL_E_MSGBODYHEADERERROR:        return "RIL_E_SMSC::MSGBODYHEADERERROR";  case RIL_E_SCBUSY:                    return "RIL_E_SMSC::SCBUSY";  case RIL_E_NOSCSUBSCRIPTION:          return "RIL_E_SMSC::NOSCSUBSCRIPTION";  case RIL_E_SCSYSTEMFAILURE:           return "RIL_E_SMSC::SCSYSTEMFAILURE";  case RIL_E_INVALIDADDRESS:            return "RIL_E_SMSC::INVALIDADDRESS";  case RIL_E_DESTINATIONBARRED:         return "RIL_E_SMSC::DESTINATIONBARRED";  case RIL_E_REJECTEDDUPLICATE:         return "RIL_E_SMSC::REJECTEDDUPLICATE";  case RIL_E_VPFUNSUPPORTED:            return "RIL_E_SMSC::VPFUNSUPPORTED";  case RIL_E_VPUNSUPPORTED:             return "RIL_E_SMSC::VPUNSUPPORTED";  case RIL_E_SIMMSGSTORAGEFULL:         return "RIL_E_STORAGE::SIMMSGSTORAGEFULL";  case RIL_E_NOSIMMSGSTORAGE:           return "RIL_E_SIM::NOSIMMSGSTORAGE";  case RIL_E_SIMTOOLKITBUSY:            return "RIL_E_SIM::SIMTOOLKITBUSY";  case RIL_E_SIMDOWNLOADERROR:          return "RIL_E_SIM::SIMDOWNLOADERROR";  case RIL_E_MSGSVCRESERVED:            return "RIL_E_NETWORKUNSUPPORTED::MSGSVCRESERVED";  case RIL_E_INVALIDMSGPARAM:           return "RIL_E_BADPARAM::INVALIDMSGPARAM";  case RIL_E_UNKNOWNSCADDRESS:          return "RIL_E_SMSC::UNKNOWNSCADDRESS";  case RIL_E_UNASSIGNEDNUMBER:          return "RIL_E_DESTINATION::UNASSIGNEDNUMBER";  case RIL_E_MSGBARREDBYOPERATOR:       return "RIL_E_NETWORKACCESS::MSGBARREDBYOPERATOR";  case RIL_E_MSGCALLBARRED:             return "RIL_E_NETWORKACCESS::MSGCALLBARRED";  case RIL_E_MSGXFERREJECTED:           return "RIL_E_DESTINATION::MSGXFERREJECTED";  case RIL_E_DESTINATIONOUTOFSVC:       return "RIL_E_DESTINATION::DESTINATIONOUTOFSVC";  case RIL_E_UNIDENTIFIEDSUBCRIBER:     return "RIL_E_NETWORKACCESS::UNIDENTIFIEDSUBCRIBE";  case RIL_E_SVCUNSUPPORTED:            return "RIL_E_NETWORKUNSUPPORTED::SVCUNSUPPORTED";  case RIL_E_UNKNOWNSUBSCRIBER:         return "RIL_E_NETWORKACCESS::UNKNOWNSUBSCRIBER";  case RIL_E_NETWKOUTOFORDER:           return "RIL_E_NETWORK::NETWKOUTOFORDER";  case RIL_E_NETWKTEMPFAILURE:          return "RIL_E_NETWORK::NETWKTEMPFAILURE";  case RIL_E_CONGESTION:                return "RIL_E_NETWORK::CONGESTION";  case RIL_E_RESOURCESUNAVAILABLE:      return "RIL_E_NONE::RESOURCESUNAVAILABLE";  case RIL_E_SVCNOTSUBSCRIBED:          return "RIL_E_NETWORKUNSUPPORTED::SVCNOTSUBSCRIBED";  case RIL_E_SVCNOTIMPLEMENTED:         return "RIL_E_NETWORKUNSUPPORTED::SVCNOTIMPLEMENTED";  case RIL_E_INVALIDMSGREFERENCE:       return "RIL_E_BADPARAM::INVALIDMSGREFERENCE";  case RIL_E_INVALIDMSG:                return "RIL_E_BADPARAM::INVALIDMSG";  case RIL_E_INVALIDMANDATORYINFO:      return "RIL_E_BADPARAM::INVALIDMANDATORYINFO";  case RIL_E_MSGTYPEUNSUPPORTED:        return "RIL_E_NETWORKUNSUPPORTED::MSGTYPEUNSUPPORTED";  case RIL_E_ICOMPATIBLEMSG:            return "RIL_E_NETWORKUNSUPPORTED::ICOMPATIBLEMSG";  case RIL_E_INFOELEMENTUNSUPPORTED:    return "RIL_E_NETWORKUNSUPPORTED::INFOELEMENTUNSUPPORT";  case RIL_E_PROTOCOLERROR:             return "RIL_E_NETWORK::PROTOCOLERROR";  case RIL_E_NETWORKERROR:              return "RIL_E_NETWORK::NETWORKERROR";  case RIL_E_MESSAGINGERROR:            return "RIL_E_NETWORK::MESSAGINGERROR";  case RIL_E_NOTREADY:                  return "RIL_E_NONE::NOTREADY";  case RIL_E_TIMEDOUT:                  return "RIL_E_NONE::TIMEDOUT";  case RIL_E_CANCELLED:                 return "RIL_E_NONE::CANCELLED";  case RIL_E_NONOTIFYCALLBACK:          return "RIL_E_NONE::NONOTIFYCALLBACK";  case RIL_E_OPFMTUNAVAILABLE:          return "RIL_E_NETWORKUNSUPPORTED::OPFMTUNAVAILABLE";  case RIL_E_NORESPONSETODIAL:          return "RIL_E_NETWORKACCESS::NORESPONSETODIAL";  case RIL_E_SECURITYFAILURE:           return "RIL_E_NONE::SECURITYFAILURE";  case RIL_E_RADIOFAILEDINIT:           return "RIL_E_NONE::RADIOFAILEDINIT";  case RIL_E_DRIVERINITFAILED:          return "RIL_E_RADIOUNAVAILABLE::DRIVERINITFAILED";  case RIL_E_RADIONOTPRESENT:           return "RIL_E_RADIOUNAVAILABLE::RADIONOTPRESENT";  case RIL_E_RADIOOFF:                  return "RIL_E_RADIOUNAVAILABLE::RADIOOFF";    default:      return stringformat("%s::%02x", RilErrorClassString(RILERRORCLASS(dwError)).c_str(), dwError&0xff);      }  }    std::string RilInfoClassString(DWORD dwClass)  {      StringList list;      if (dwClass&RIL_INFOCLASS_VOICE) list.push_back("Voice");      if (dwClass&RIL_INFOCLASS_DATA) list.push_back("Data");      if (dwClass&RIL_INFOCLASS_FAX) list.push_back("Fax");      if (dwClass&RIL_INFOCLASS_SMS) list.push_back("SMS");      if (dwClass&RIL_INFOCLASS_DATACIRCUITSYNC) list.push_back("DataCircuitSync");      if (dwClass&RIL_INFOCLASS_DATACIRCUITASYNC) list.push_back("DataCircuitASync");      if (dwClass&RIL_INFOCLASS_PACKETACCESS) list.push_back("PacketAccess");      if (dwClass&RIL_INFOCLASS_PADACCESS) list.push_back("PadAccess");        DWORD dwAll= RIL_INFOCLASS_VOICE|RIL_INFOCLASS_DATA|RIL_INFOCLASS_FAX|RIL_INFOCLASS_SMS|RIL_INFOCLASS_DATACIRCUITSYNC|RIL_INFOCLASS_DATACIRCUITASYNC|RIL_INFOCLASS_PACKETACCESS|RIL_INFOCLASS_PADACCESS;      if (dwClass & ~ dwAll) list.push_back(stringformat("RIL_INFOCLASS_%x", dwClass & ~ dwAll));        return JoinStringList(list, ",");  }    RilClass::RilClass()  {      m_hRil= 0;      m_hrCallListRequest= 0;      m_hrEquipmentInfoRq= 0;      m_hrEquipmentStateRequest= 0;      m_hrCurrentAddressIdRequest= 0;      m_hrSignalQualityRequest= 0;      m_hrSimRecordStatusRequest= 0;      m_hrAudioDevicesRequest= 0;      m_hrAudioMutingRequest= 0;      m_hrCellTowerInfoRequest= 0;      m_hrSubscriberNumbersRequest= 0;      m_hrLockedStateRequest= 0;      m_hrSetAudioMutingRequest= 0;      m_hrGetCallWaitingRequest= 0;      m_hrSetCallWaitingRequest= 0;        m_hrCBSRequest= 0;      m_hrCellIdRequest= 0;      m_hrRestrictedSimCmdRequest= 0;    }  RilClass::~RilClass()  {      close();  }  bool RilClass::open(DWORD dwIndex)  {  #ifdef _HAVE_RIL      HRESULT res= RIL_Initialize(dwIndex, &ResultProc, &NotifyProc, -1, (DWORD)this, &m_hRil);      if (res)      {          error("RIL_Initialize: %08lx\n", res);          return false;      }  

0 件のコメント:

コメントを投稿